C
Cyril Mrazek
Hello,
I have a byte array, I get it from a Blob, such that if I write it
into a FileOutputStream, I get a file on the disk:
.... some SQL
Blob blob = rs.getBlob(1);
int c = (int)blob.length();
byte[] buf = blob.getBytes(1, c);
FileOutputStream fos = new FileOutputStream("sample.jpg");
fos.write(buf, 0, c);
....
and it works fine. Now I would like to generate an Image, or a
BufferedImage, from that buffer and I can't find a way to do it. Any
hint ?
Thanks
Cyril Mrazek
I have a byte array, I get it from a Blob, such that if I write it
into a FileOutputStream, I get a file on the disk:
.... some SQL
Blob blob = rs.getBlob(1);
int c = (int)blob.length();
byte[] buf = blob.getBytes(1, c);
FileOutputStream fos = new FileOutputStream("sample.jpg");
fos.write(buf, 0, c);
....
and it works fine. Now I would like to generate an Image, or a
BufferedImage, from that buffer and I can't find a way to do it. Any
hint ?
Thanks
Cyril Mrazek