Converting BufferedImage to Byte is simple in Java. Review the code below:

Java Code:
private byte[] image_byte_data(BufferedImage image)
{
    WritableRaster raster = image.getRaster();
    DataBufferByte buffer = (DataBufferByte)raster.getDataBuffer();
    return buffer.getData();
}