Add close method to clean up work space

This commit is contained in:
Taro L. Saito 2011-06-30 14:10:32 +09:00
parent 4281128209
commit da64065e18
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,14 @@ public class SnappyInputStream extends InputStream
readHeader();
}
@Override
public void close() throws IOException {
compressed = null;
uncompressed = null;
if (in != null)
in.close();
}
protected void readHeader() throws IOException {
byte[] header = new byte[SnappyCodec.headerSize()];
int readBytes = in.read(header, 0, header.length);