title: error Unexpected end of ZLIB input stream
body: <p>While converting the <code>InputStream</code> to <code>BufferedImage</code> I am getting the below error </p>
  
  <pre><code>byte[] imgBytes = decoder.decode(encodedStr);
  </code></pre>
  
  <p>This line is executing fine and generating the byte array properly</p>
  
  <pre><code>InputStream in = new ByteArrayInputStream(imgBytes);
  BufferedImage  bImageFromConvert = ImageIO.read(in);
  </code></pre>
  
  <p>This line is giving error as it is unable to read the <code>InputStream</code> properly</p>
  
  <pre><code>Below is the error
      javax.imageio.IIOException: Error reading PNG image data
        at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at DecodeSignatureFile.generateImage(DecodeSignatureFile.java:252)
        at DecodeSignatureFile.getContents(DecodeSignatureFile.java:176)
        at DecodeSignatureFile.process(DecodeSignatureFile.java:322)
        at DecodeSignatureFile.main(DecodeSignatureFile.java:334)
  Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
        at java.util.zip.InflaterInputStream.fill(Unknown Source)
        at java.util.zip.InflaterInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.DataInputStream.readFully(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.decodePass(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(Unknown Source)
        ... 8 more
  </code></pre>