cpw.mods.fml.repackage.com.nothome.delta

## Class GDiffWriter

- java.lang.Object
- - cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter

- All Implemented Interfaces:
    DiffWriter, Closeable, AutoCloseable

      public class GDiffWriter
      extends Object
      implements DiffWriter

  Outputs a diff following the GDIFF file specification available at http://www.w3.org/TR/NOTE-gdiff-19970901.html.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CHUNK_SIZE` Max length of a chunk.
    `static int` | `COPY_INT_INT`
    `static int` | `COPY_INT_UBYTE`
    `static int` | `COPY_INT_USHORT`
    `static int` | `COPY_LONG_INT`
    `static int` | `COPY_USHORT_INT`
    `static int` | `COPY_USHORT_UBYTE`
    `static int` | `COPY_USHORT_USHORT`
    `static int` | `DATA_INT`
    `static int` | `DATA_MAX` Max length for single length data encode.
    `static int` | `DATA_USHORT`
    `static byte` | `EOF`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GDiffWriter(DataOutputStream os)` Constructs a new GDiffWriter.
    `GDiffWriter(OutputStream output)` Constructs a new GDiffWriter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCopy(long offset, int length)` Add a GDIFF copy instruction.
    `void` | `addData(byte b)` Adds a data byte.
    `void` | `close()` Writes the final EOF byte, closes the underlying stream.
    `void` | `flush()` Flushes accumulated data bytes, if any.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CHUNK_SIZE

          public static final int CHUNK_SIZE

      Max length of a chunk.
      See Also:
        Constant Field Values

    - #### EOF

          public static final byte EOF

      See Also:
        Constant Field Values

    - #### DATA_MAX

          public static final int DATA_MAX

      Max length for single length data encode.
      See Also:
        Constant Field Values

    - #### DATA_USHORT

          public static final int DATA_USHORT

      See Also:
        Constant Field Values

    - #### DATA_INT

          public static final int DATA_INT

      See Also:
        Constant Field Values

    - #### COPY_USHORT_UBYTE

          public static final int COPY_USHORT_UBYTE

      See Also:
        Constant Field Values

    - #### COPY_USHORT_USHORT

          public static final int COPY_USHORT_USHORT

      See Also:
        Constant Field Values

    - #### COPY_USHORT_INT

          public static final int COPY_USHORT_INT

      See Also:
        Constant Field Values

    - #### COPY_INT_UBYTE

          public static final int COPY_INT_UBYTE

      See Also:
        Constant Field Values

    - #### COPY_INT_USHORT

          public static final int COPY_INT_USHORT

      See Also:
        Constant Field Values

    - #### COPY_INT_INT

          public static final int COPY_INT_INT

      See Also:
        Constant Field Values

    - #### COPY_LONG_INT

          public static final int COPY_LONG_INT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GDiffWriter

          public GDiffWriter(DataOutputStream os)
                      throws IOException

      Constructs a new GDiffWriter.
      Throws:
        `IOException`

    - #### GDiffWriter

          public GDiffWriter(OutputStream output)
                      throws IOException

      Constructs a new GDiffWriter.
      Throws:
        `IOException`

  - ### Method Detail

    - #### addCopy

          public void addCopy(long offset,
                     int length)
                       throws IOException

      Description copied from interface: `DiffWriter`
      Add a GDIFF copy instruction.
      Specified by:
        `addCopy` in interface `DiffWriter`
      Throws:
        `IOException`

    - #### addData

          public void addData(byte b)
                       throws IOException

      Adds a data byte.
      Specified by:
        `addData` in interface `DiffWriter`
      Throws:
        `IOException`

    - #### flush

          public void flush()
                     throws IOException

      Flushes accumulated data bytes, if any.
      Specified by:
        `flush` in interface `DiffWriter`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Writes the final EOF byte, closes the underlying stream.
      Specified by:
        `close` in interface `DiffWriter`
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`