I need to know how to get a byte array from an uploaded image in java. BufferedImage doesn't seem to provide any methods that produce a byte array, so what am I using?
BufferedImage bufferedImage; //assumed that you have created it already
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
ImageIO.write(bufferedImage,"jpg", byteStream);
byte[] byteArray = byteStream.toByteArray();