public class GzipFileBuffer extends FileBuffer
_file, _offset, _sublen| Constructor and Description |
|---|
GzipFileBuffer(File file)Create a GzipFileBuffer for the entire file. |
GzipFileBuffer(File file,
int offset,
int sublen)Create a GzipFileBuffer for a portion of the uncompressed data. |
| Modifier and Type | Method and Description |
|---|---|
InputStream | getInputStream()Get a GZIP decompressing InputStream, wrapped with a counter. |
int | getLength()Returns the actual uncompressed size. |
OutputStream | getOutputStream()Get a GZIP compressing OutputStream, wrapped with a counter. |
void | readComplete(boolean success)Close the input stream and record the uncompressed length if successful. |
String | toString() |
void | writeComplete(boolean success)Close the output stream and record the uncompressed length if successful. |
getFile, getOffsetpublic GzipFileBuffer(File file)
file - the gzip-compressed filepublic GzipFileBuffer(File file, int offset, int sublen)
file - the gzip-compressed fileoffset - the byte offset to start reading from (uncompressed)sublen - the number of bytes to read (uncompressed), or 0 for allpublic InputStream getInputStream() throws IOException
getInputStream in interface BuffergetInputStream in class FileBufferIOException - on I/O errorpublic int getLength()
getLength in interface BuffergetLength in class FileBufferpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface BuffergetOutputStream in class FileBufferIllegalStateException - if offset > 0 or already open for writingIOException - on I/O errorpublic void readComplete(boolean success)
readComplete in interface BufferreadComplete in class FileBuffersuccess - if true, records the bytes readpublic String toString()
toString in class FileBufferpublic void writeComplete(boolean success)
writeComplete in interface BufferwriteComplete in class FileBuffersuccess - if true, records the bytes written