/ Published in: Java
                    
                                        i use it so save bufferedImages into a DB as Blob
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 public static byte[] bufferedImageToByteArray(BufferedImage img) throws ImageFormatException, IOException{ JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os); encoder.encode(img); return os.toByteArray(); }
Comments
                    Subscribe to comments
                
                