title: Java: Get the RGBA from a Buffered Image as an Array of Integer
body: <p>Given an image file, say of PNG format, how to I get an array of int [r,g,b,a] representing the pixel located at row i, column j?</p>
  
  <p>So far I am starting here:</p>
  
  <pre><code>private static int[][][] getPixels(BufferedImage image) {
  
      final byte[] pixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
      final int width = image.getWidth();
      final int height = image.getHeight();
  
      int[][][] result = new int[height][width][4];
  
      // SOLUTION GOES HERE....
  }
  </code></pre>
  
  <p>Thanks in advance!</p>