title: jzlib 1.0.7: ArrayOutOfBoundException in ZOutputStream.write()
body: <p>I have a simple test case producing a sure ArrayOutOfBoundException in jzlib
  1.0.7 depending on the data subsequently written to one and the same instance
  of ZOutputStream.</p>
  
  <p>Stacktrace:</p>
  
  <pre><code>java.lang.ArrayIndexOutOfBoundsException: 587
      at com.jcraft.jzlib.Tree.d_code(Tree.java:149)
      at com.jcraft.jzlib.Deflate.compress_block(Deflate.java:691)
      at com.jcraft.jzlib.Deflate._tr_flush_block(Deflate.java:897)
      at com.jcraft.jzlib.Deflate.flush_block_only(Deflate.java:772)
      at com.jcraft.jzlib.Deflate.deflate_slow(Deflate.java:1195)
      at com.jcraft.jzlib.Deflate.deflate(Deflate.java:1567)
      at com.jcraft.jzlib.ZStream.deflate(ZStream.java:133)
      at com.jcraft.jzlib.ZOutputStream.write(ZOutputStream.java:102)
      at com.jcraft.jzlib.JZLibTestCase.main(JZLibTestCase.java:51)
         at JZLibTestCase.main(JZLibTestCase.java:28)
  </code></pre>
  
  <p>The problem occurs very rarely and depends on the data subsequentially
  written to an open ZOutputStream from jzlib.</p>
  
  <p>Do you have a hint how to fix this? Have you ever heard of this?</p>