code: public static void writeOut(BufferedImage image, OutputStream os, String format) throws IOException {
  	ImageIO.write(image, format, os);
  
      }
docs: write out image object to a output stream
  
  @param image
  @param os
  @param format
  @throws IOException