dcsimg
write byte[] to file?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bubly_K
Posted On:   Wednesday, August 11, 2004 09:24 AM

How do I write a byte[] to an image file?

Re: write byte[] to file?

Posted By:   Gerrit_Goetsch  
Posted On:   Wednesday, August 11, 2004 09:56 AM

You can use a java.io.FileOutputStream.

There is a method write(byte byte[]) which you can use to write any byte array to a file.



The simplest way is something like:

byte[] b = new byte[10];
java.io.FileOutputStream out = new java.io.FileOutputStream("filename");
out.write(b);
out.flush();
out.close();

Re: write byte[] to file?

Posted By:   Simon_Ablett  
Posted On:   Wednesday, August 11, 2004 09:52 AM

It would depend on the expected format of the file.
About | Sitemap | Contact