Package i2p.susi.util
Class GzipFileBuffer
java.lang.Object
i2p.susi.util.FileBuffer
i2p.susi.util.GzipFileBuffer
- All Implemented Interfaces:
Buffer
public class GzipFileBuffer extends FileBuffer
Gzip File implementation of Buffer.
- Since:
- 0.9.34
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GzipFileBuffer(File file)GzipFileBuffer(File file, int offset, int sublen) -
Method Summary
Modifier and Type Method Description InputStreamgetInputStream()Caller must call readComplete()intgetLength()Returns the actual uncompressed size.OutputStreamgetOutputStream()Caller must call writeComplete()voidreadComplete(boolean success)Top-level reader MUST call this to close the input stream.StringtoString()voidwriteComplete(boolean success)Sets the length if success is true
-
Constructor Details
-
Method Details
-
getInputStream
Description copied from class:FileBufferCaller must call readComplete()- Specified by:
getInputStreamin interfaceBuffer- Overrides:
getInputStreamin classFileBuffer- Returns:
- new FileInputStream
- Throws:
IOException
-
getOutputStream
Description copied from class:FileBufferCaller must call writeComplete()- Specified by:
getOutputStreamin interfaceBuffer- Overrides:
getOutputStreamin classFileBuffer- Returns:
- new FileOutputStream
- Throws:
IOException
-
readComplete
public void readComplete(boolean success)Description copied from interface:BufferTop-level reader MUST call this to close the input stream.- Specified by:
readCompletein interfaceBuffer- Overrides:
readCompletein classFileBuffer
-
writeComplete
public void writeComplete(boolean success)Sets the length if success is true- Specified by:
writeCompletein interfaceBuffer- Overrides:
writeCompletein classFileBuffer- Parameters:
success- if false, deletes any resources
-
getLength
public int getLength()Returns the actual uncompressed size. Only known after reading and calling readComplete(true), or after writing and calling writeComplete(true), oherwise returns 0.- Specified by:
getLengthin interfaceBuffer- Overrides:
getLengthin classFileBuffer
-
toString
- Overrides:
toStringin classFileBuffer
-