Hi,<div><br></div><div>I am not sure if I can make code changes in the JSword-common but I haven&#39;t made any before so I thought I would request the change.</div><div><br></div><div>In Zip.java, in the uncompress method, could you change:</div>
<div><div>        ByteArrayOutputStream bos = new ByteArrayOutputStream();</div><div>        BufferedOutputStream out = new BufferedOutputStream(bos, expectedLength);</div><div>        InflaterInputStream in = new InflaterInputStream(input, new Inflater(), expectedLength);</div>
<div>        byte[] buf = new byte[expectedLength];</div></div><div>To:</div><div><div>        ByteArrayOutputStream out = new ByteArrayOutputStream(expectedLength);</div><div>        InflaterInputStream in = new InflaterInputStream(input, new Inflater(), expectedLength);</div>
<div>        byte[] buf = new byte[expectedLength];</div></div><div><br></div><div>There are 2 optimisations:</div><div><ol><li>ByteArrrayOutputStream is passed the expectedLength parameter</li><li>BufferedOutputStream is not used because there is no benefit to buffering byte array streams.</li>
</ol><div>These changes may seem trivial but I am attempting to use JSword on an Android mobile and the above prevents many OutOfMemory errors.</div></div><div><br></div><div>Many thanks</div><div>Martin</div>