Class BmpEncoder


  • public class BmpEncoder
    extends Object
    Class writes BufferedImages as Bmp

    Example:

    
     BmpEncoder encoder = new BmpEncoder();
     encoder.write(image, outputStream);
     
    • Constructor Detail

      • BmpEncoder

        public BmpEncoder()
    • Method Detail

      • write

        public void write​(BufferedImage image,
                          OutputStream outputStream)
                   throws IOException
        Writes BufferedImage as a BMP into an OutputStream

        This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream.

        Parameters:
        image - BufferedImage to write
        outputStream - The stream to write the image to
        Throws:
        IOException - if the image wasn't written