Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating image from byte array

807606May 28 2007 — edited May 28 2007
Hi,
I am storing an image as BLOB into database and then reading it as byte array and trying to convert it to an image ( get back the original image). I am using the following code. But when I print the image object, it prints null.

BufferedImage image = ImageIO.read( new ByteArrayInputStream( imageBuf ) );

Can I not store an image simply as a byte array and then get the image back from that byte array?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2007
Added on May 28 2007
3 comments
258 views