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-compressed file Buffer implementation.

- - ### Field Summary

    - ### Fields inherited from class i2p.susi.util.FileBuffer

      `_file, _offset, _sublen`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GzipFileBuffer(File file)`
    `GzipFileBuffer(File file, int offset, int sublen)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InputStream` | `getInputStream()` Caller must call readComplete()
    `int` | `getLength()` Returns the actual uncompressed size.
    `OutputStream` | `getOutputStream()` Caller must call writeComplete()
    `void` | `readComplete(boolean success)` Top-level reader MUST call this to close the input stream.
    `String` | `toString()`
    `void` | `writeComplete(boolean success)` Sets the length if success is true

    - ### Methods inherited from class i2p.susi.util.FileBuffer

      `getFile, getOffset`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GzipFileBuffer

          public GzipFileBuffer(File file)

    - #### GzipFileBuffer

          public GzipFileBuffer(File file,
                                int offset,
                                int sublen)

  - ### Method Detail

    - #### getInputStream

          public InputStream getInputStream()
                                     throws IOException

      Description copied from class: `FileBuffer`
      Caller must call readComplete()
      Specified by:
        `getInputStream` in interface `Buffer`
      Overrides:
        `getInputStream` in class `FileBuffer`
      Returns:
        new FileInputStream
      Throws:
        `IOException`

    - #### 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:
        `getLength` in interface `Buffer`
      Overrides:
        `getLength` in class `FileBuffer`

    - #### getOutputStream

          public OutputStream getOutputStream()
                                       throws IOException

      Description copied from class: `FileBuffer`
      Caller must call writeComplete()
      Specified by:
        `getOutputStream` in interface `Buffer`
      Overrides:
        `getOutputStream` in class `FileBuffer`
      Returns:
        new FileOutputStream
      Throws:
        `IOException`

    - #### readComplete

          public void readComplete(boolean success)

      Description copied from interface: `Buffer`
      Top-level reader MUST call this to close the input stream.
      Specified by:
        `readComplete` in interface `Buffer`
      Overrides:
        `readComplete` in class `FileBuffer`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `FileBuffer`

    - #### writeComplete

          public void writeComplete(boolean success)

      Sets the length if success is true
      Specified by:
        `writeComplete` in interface `Buffer`
      Overrides:
        `writeComplete` in class `FileBuffer`
      Parameters:
        `success` - if false, deletes any resources