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

## Class ByteBufferSeekableSource

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

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

      public class ByteBufferSeekableSource
      extends java.lang.Object
      implements SeekableSource

  Wraps a byte buffer as a source

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteBufferSeekableSource(byte[] source)` Constructs a new ByteArraySeekableSource.
    `ByteBufferSeekableSource(java.nio.ByteBuffer bb)` Constructs a new ByteArraySeekableSource.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `int` | `read(java.nio.ByteBuffer dest)` Reads up to `Buffer.remaining()` bytes from the source, returning the number of bytes read, or -1 if no bytes were read and EOF was reached.
    `void` | `seek(long pos)` Sets the position for the next `SeekableSource.read(ByteBuffer)`.
    `java.lang.String` | `toString()` Returns a debug `String`.

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

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

- - ### Constructor Detail

    - #### ByteBufferSeekableSource

          public ByteBufferSeekableSource(byte[] source)

      Constructs a new ByteArraySeekableSource.

    - #### ByteBufferSeekableSource

          public ByteBufferSeekableSource(java.nio.ByteBuffer bb)

      Constructs a new ByteArraySeekableSource.

  - ### Method Detail

    - #### seek

          public void seek(long pos)
                    throws java.io.IOException

      Description copied from interface: `SeekableSource`
      Sets the position for the next `SeekableSource.read(ByteBuffer)`.
      Specified by:
        `seek` in interface `SeekableSource`
      Throws:
        `java.io.IOException`

    - #### read

          public int read(java.nio.ByteBuffer dest)
                   throws java.io.IOException

      Description copied from interface: `SeekableSource`
      Reads up to `Buffer.remaining()` bytes from the source, returning the number of bytes read, or -1 if no bytes were read and EOF was reached.
      Specified by:
        `read` in interface `SeekableSource`
      Throws:
        `java.io.IOException`

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `java.io.IOException`

    - #### toString

          public java.lang.String toString()

      Returns a debug `String`.
      Overrides:
        `toString` in class `java.lang.Object`