title: java.awt.image.DataBufferInt cannot be cast to java.awt.image.DataBufferByte
body: <pre><code>private static byte[] get_byte_data(BufferedImage image)
  {
      //WritableRaster raster   = image.getRaster();
      DataBufferByte buffer = (DataBufferByte)image.getRaster().getDataBuffer();
      return buffer.getData();
  }
  </code></pre>
  
  <p>I get the stated class cast exception while executing the above piece of code. I need the byte[] array to be returned. i.e the bytes of the bufferedimage.</p>