// tell Deflater that it got all the input
defl.finish();
// retrieve remaining compressed data from defl to outBuffer
do
{
numDeflated = defl.deflate(outBuffer, outOffset, outBuffer.length - outOffset);
outOffset += numDeflated;
if (outOffset == outBuffer.length)
{
saveChunk(CHUNK_TYPE_IDAT, outOffset, outBuffer);
outOffset = 0;