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

## Class GDiffWriter

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

- All Implemented Interfaces:
    DiffWriter, java.io.Closeable, java.lang.AutoCloseable

      public class GDiffWriter
      extends java.lang.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(java.io.DataOutputStream os)` Constructs a new GDiffWriter.
    `GDiffWriter(java.io.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

      `clone, equals, finalize, 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(java.io.DataOutputStream os)
                      throws java.io.IOException

      Constructs a new GDiffWriter.
      Throws:
        `java.io.IOException`

    - #### GDiffWriter

          public GDiffWriter(java.io.OutputStream output)
                      throws java.io.IOException

      Constructs a new GDiffWriter.
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### addCopy

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

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

    - #### addData

          public void addData(byte b)
                       throws java.io.IOException

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

    - #### flush

          public void flush()
                     throws java.io.IOException

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

    - #### close

          public void close()
                     throws java.io.IOException

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