title: Converting byte array to bufferedimage results in null
body: <p>I am trying to convert a byte array of length 128 to a 32x32 bitmap stored in a BufferedImage.
  I am using the following code:</p>
  
  <pre><code>private BufferedImage fSP;
  
  public Pattern( byte[] aBitData ) {
    if ( aBitData == null ) {
      throw new IllegalArgumentException( "Please provide a non-null byte array of length 128: " + aBitData );
    }
    else if ( aBitData.length != 128 ) {
      throw new IllegalArgumentException( "Please provide a non-null byte array of length 128: " + aBitData.length );
    }
    InputStream in = new ByteArrayInputStream( aBitData );
    try {
      fSP = ImageIO.read( in );
    } catch( IOException e ) {
      e.printStackTrace();
    }
  }
  </code></pre>
  
  <p>But every time fSP is set to null for some reason. I don't understand why this happens. Could anyone help me out?</p>