/ Published in: Java
i use it so save bufferedImages into a DB as Blob
Expand |
Embed | Plain Text
public static byte[] bufferedImageToByteArray(BufferedImage img) throws ImageFormatException, IOException{ JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os); encoder.encode(img); return os.toByteArray(); }
You need to login to post a comment.
