23
First of all you must get your "bytes":
byte[] buffer = ((DataBufferByte)(bufferedImage).getRaster().getDataBuffer()).getData();
And then use ByteArrayInputStream(byte[] buf) constructor to create your InputStream;
You need to save the BufferedImage to a ByteArrayOutputStream using the ImageIO class, then create a ByteArrayInputStream from toByteArray().