Gal
Gal

Reputation: 5416

Execute a bytestream as a process in Java without writing to file

Basically, I want to be able execute a byte stream as a file, without writing said bytes to a file.

I want to do this in a windows environment.

You could say I want a to create a file, copy the stream to the file, and open the file as an executable, but I want the file to have no physical manifestation on the disk.

Thanks

Upvotes: 4

Views: 260

Answers (2)

Denys Séguret
Denys Séguret

Reputation: 382150

Supposing you bytestream is the one of a standard exe, and you don't want to call a whole virtualisation environnement, the short answer is no because internal adresses in the code wouldn't map.

Here's a more detailled answer :

process.start() embedded exe without extracting to file first c#

Upvotes: 1

aioobe
aioobe

Reputation: 421020

This is not possible to do using the standard Java API. You will have to rely on some OS specific native implementations, either that do the whole thing for you, or that allow you to create some sort of RAM-disk on which you can place your temporary data and execute it.

Possibly related:

Upvotes: 3

Related Questions