lev

## Class LShrinkArray

- java.lang.Object
- - lev.LImport
  - - lev.LShrinkArray

-     public class LShrinkArray
      extends LImport

  A special array with artificial min/max bounds. This allows smaller parts of the array to be passed around without actually copying the data to a new smaller array. It also provides extract functions which bump the lower limit of the ShrinkArray's scope, so that a following extract function can be called without having to worry about offset indexing.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LShrinkArray(byte[] in)` Wraps bytes in a ShrinkArray.
    `LShrinkArray(java.nio.ByteBuffer array_)` Wraps ByteBuffer in a ShrinkArray.
    `LShrinkArray(java.io.File f)` Loads in a file as raw data and wraps it in a ShrinkArray.
    `LShrinkArray(LImport rhs, int high)` Creates a new ShrinkArray based on the same underlying array, starting at the same beginning index of the rhs LImport, but with an upper limit of high.
    `LShrinkArray(LShrinkArray rhs)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `close()`
    `byte[]` | `extract(int amount)` Extracts specified number of bytes.
    `byte[]` | `extractUntil(int delimiter)` Extracts bytes until the delemiter is read. Bumps the lower bound up so that following extracts do not extract the same data.
    `byte[]` | `extractUntil(java.lang.String delimiter)`
    `java.lang.Boolean` | `isDone()`
    `void` | `jumpBack(int amount)` Bumps the lower bound back to include bytes previously read/skipped or outside the current bounds.
    `long` | `pos()`
    `void` | `pos(long pos)`
    `void` | `skip(int skip)` Bumps the lower bound up to "skip" that many bytes.
    `java.lang.String` | `toString()`

    - ### 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, read, scanTo`

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

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

- - ### Constructor Detail

    - #### LShrinkArray

          public LShrinkArray(byte[] in)

      Wraps bytes in a ShrinkArray.
      Parameters:
        `in` -

    - #### LShrinkArray

          public LShrinkArray(java.nio.ByteBuffer array_)

      Wraps ByteBuffer in a ShrinkArray.
      Parameters:
        `array_` -

    - #### LShrinkArray

          public LShrinkArray(LImport rhs,
                      int high)

      Creates a new ShrinkArray based on the same underlying array, starting at the same beginning index of the rhs LImport, but with an upper limit of high.
      Parameters:
        `rhs` - LImport to copy bounds from.
        `high` - New upper limit to give to the ShrinkArray.

    - #### LShrinkArray

          public LShrinkArray(LShrinkArray rhs)

      Parameters:
        `rhs` -

    - #### LShrinkArray

          public LShrinkArray(java.io.File f)
                       throws java.io.FileNotFoundException,
                              java.io.IOException

      Loads in a file as raw data and wraps it in a ShrinkArray.
      Parameters:
        `f` - File to load in.
      Throws:
        `java.io.FileNotFoundException`
        `java.io.IOException`

  - ### Method Detail

    - #### isDone

          public java.lang.Boolean isDone()

      Overrides:
        `isDone` in class `LImport`
      Returns:
        True if ShrinkArray has no bytes left to extract.

    - #### available

          public final int available()

      Specified by:
        `available` in class `LImport`
      Returns:
        Amount of bytes left in the bounds of the ShrinkArray.

    - #### skip

          public final void skip(int skip)

      Bumps the lower bound up to "skip" that many bytes.
      Overrides:
        `skip` in class `LImport`
      Parameters:
        `skip` - Bytes to skip over.

    - #### jumpBack

          public void jumpBack(int amount)

      Bumps the lower bound back to include bytes previously read/skipped or outside the current bounds.
      Overrides:
        `jumpBack` in class `LImport`
      Parameters:
        `amount` - Amount to jump back.

    - #### extractUntil

          public byte[] extractUntil(int delimiter)

      Extracts bytes until the delemiter is read.
      Bumps the lower bound up so that following extracts do not extract the same data.
      Overrides:
        `extractUntil` in class `LImport`
      Parameters:
        `delimiter` - Integer at which to stop reading.
      Returns:
        Bytes read excluding the signaling delimiter.

    - #### extractUntil

          public byte[] extractUntil(java.lang.String delimiter)

      Parameters:
        `delimiter` -
      Returns:

    - #### extract

          public byte[] extract(int amount)

      Extracts specified number of bytes.
      Bumps the lower bound up so that following extracts do not extract the same data.
      Specified by:
        `extract` in class `LImport`
      Parameters:
        `amount` - Amount to read.
      Returns:
        byte array.

    - #### pos

          public void pos(long pos)

      Specified by:
        `pos` in class `LImport`

    - #### pos

          public long pos()

      Specified by:
        `pos` in class `LImport`
      Returns:
        @throws IOException

    - #### close

          public void close()

      Specified by:
        `close` in class `LImport`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`