lev

## Class LInChannel

- java.lang.Object
- - lev.LImport
  - - lev.LInChannel

-     public class LInChannel
      extends LImport

  A FileChannel setup that supports easy extraction/getting of information.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `end`
    `protected java.nio.channels.FileChannel` | `iChannel`
    `protected java.io.FileInputStream` | `iStream`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LInChannel()`
    `LInChannel(java.io.File f)`
    `LInChannel(LInChannel rhs, long allocation)`
    `LInChannel(java.lang.String path)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `close()` Closes streams.
    `byte[]` | `extract(int amount)` Reads in amount of bytes and converts them to integers. Moves position forward.
    `java.nio.ByteBuffer` | `extractByteBuffer(int skip, int read)` Reads in the desired bytes and wraps them in a ByteBuffer.
    `byte[]` | `extractUntil(int delimiter)` Reads in bytes until the delimiter is read.
    `java.lang.Boolean` | `isDone()`
    `void` | `openFile(java.io.File f)`
    `void` | `openFile(java.lang.String path)`
    `long` | `pos()`
    `void` | `pos(long pos)`
    `int` | `read()` Reads in a byte and moves forward one position in the file.
    `protected void` | `slice(LInChannel rhs, long allocation)`
    `long` | `transferTo(long position, long count, java.nio.channels.WritableByteChannel target)`

    - ### Methods inherited from class lev.LImport

      `correctForCompression, extract, extractAllBytes, extractAllString, extractBool, extractFloat, extractInt, extractInt, extractInts, extractInts, extractIntSigned, extractLine, extractLong, extractString, extractString, extractString, extractUntil, extractUntil, extractUntil, extractUntil, getAllBytes, getBytes, getInts, getString, getString, jumpBack, scanTo, skip`

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

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

- - ### Field Detail

    - #### iStream

          protected java.io.FileInputStream iStream

    - #### iChannel

          protected java.nio.channels.FileChannel iChannel

    - #### end

          protected long end

  - ### Constructor Detail

    - #### LInChannel

          public LInChannel()

    - #### LInChannel

          public LInChannel(java.lang.String path)

      Parameters:
        `path` - Path to open a channel to.

    - #### LInChannel

          public LInChannel(java.io.File f)

      Parameters:
        `f` - File to open a channel to.

    - #### LInChannel

          public LInChannel(LInChannel rhs,
                    long allocation)

      Parameters:
        `rhs` -
        `allocation` -

  - ### Method Detail

    - #### slice

          protected void slice(LInChannel rhs,
                   long allocation)

      Parameters:
        `rhs` -
        `allocation` -

    - #### openFile

          public void openFile(java.lang.String path)

      Parameters:
        `path` - Path to open a channel to.

    - #### openFile

          public void openFile(java.io.File f)

      Parameters:
        `f` - File to open a channel to.

    - #### read

          public int read()

      Reads in a byte and moves forward one position in the file.
      Overrides:
        `read` in class `LImport`
      Returns:
        The next int in the file.

    - #### extractByteBuffer

          public java.nio.ByteBuffer extractByteBuffer(int skip,
                                              int read)

      Reads in the desired bytes and wraps them in a ByteBuffer.
      Parameters:
        `skip` - Bytes to skip
        `read` - Bytes to read and convert
      Returns:
        ByteBuffer containing read bytes.

    - #### pos

          public void pos(long pos)

      Specified by:
        `pos` in class `LImport`
      Parameters:
        `pos` - Position to move to.

    - #### pos

          public long pos()

      Specified by:
        `pos` in class `LImport`
      Returns:
        Current position.

    - #### close

          public final void close()

      Closes streams.
      Specified by:
        `close` in class `LImport`

    - #### available

          public final int available()

      Specified by:
        `available` in class `LImport`
      Returns:
        Bytes left to read in the file.

    - #### isDone

          public java.lang.Boolean isDone()

      Overrides:
        `isDone` in class `LImport`
      Returns:

    - #### extract

          public byte[] extract(int amount)

      Description copied from class: `LImport`
      Reads in amount of bytes and converts them to integers.
      Moves position forward.
      Specified by:
        `extract` in class `LImport`
      Parameters:
        `amount` -
      Returns:

    - #### extractUntil

          public byte[] extractUntil(int delimiter)

      Description copied from class: `LImport`
      Reads in bytes until the delimiter is read.
      Overrides:
        `extractUntil` in class `LImport`
      Parameters:
        `delimiter` - int to stop reading at.
      Returns:
        Byte array containing read data without delimiter.

    - #### transferTo

          public long transferTo(long position,
                        long count,
                        java.nio.channels.WritableByteChannel target)
                          throws java.io.IOException

      Parameters:
        `position` -
        `count` -
        `target` -
      Returns:
      Throws:
        `java.io.IOException`