comparison src/com/tmate/hgkit/ll/RevlogStream.java @ 33:565ce0835674

TODO added, to try stream for unzip in revlog
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 13 Jan 2011 03:42:14 +0100
parents d4fdd1845b3f
children 6061aa826a9e
comparison
equal deleted inserted replaced
32:42585c7cd641 33:565ce0835674
163 daData.seek(index.get(i).offset); 163 daData.seek(index.get(i).offset);
164 daData.readBytes(dataBuf, 0, compressedLen); 164 daData.readBytes(dataBuf, 0, compressedLen);
165 } 165 }
166 if (dataBuf[0] == 0x78 /* 'x' */) { 166 if (dataBuf[0] == 0x78 /* 'x' */) {
167 try { 167 try {
168 Inflater zlib = new Inflater(); 168 Inflater zlib = new Inflater(); // XXX Consider reuse of Inflater, and/or stream alternative
169 zlib.setInput(dataBuf, 0, compressedLen); 169 zlib.setInput(dataBuf, 0, compressedLen);
170 byte[] result = new byte[actualLen*2]; // FIXME need to use zlib.finished() instead 170 byte[] result = new byte[actualLen*2]; // FIXME need to use zlib.finished() instead
171 int resultLen = zlib.inflate(result); 171 int resultLen = zlib.inflate(result);
172 zlib.end(); 172 zlib.end();
173 data = new byte[resultLen]; 173 data = new byte[resultLen];