org.apache.commons.compress.compressors.lz77support

## Class LZ77Compressor.LiteralBlock

- java.lang.Object
- - org.apache.commons.compress.compressors.lz77support.LZ77Compressor.Block
  - - org.apache.commons.compress.compressors.lz77support.LZ77Compressor.LiteralBlock

- Enclosing class:
    LZ77Compressor

      public static final class LZ77Compressor.LiteralBlock
      extends LZ77Compressor.Block

  Represents a literal block of data.

  For performance reasons this encapsulates the real data, not a copy of it. Don't modify the data and process it inside of `LZ77Compressor.Callback.accept(org.apache.commons.compress.compressors.lz77support.LZ77Compressor.Block)` immediately as it will get overwritten sooner or later.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.commons.compress.compressors.lz77support.LZ77Compressor.Block

      `LZ77Compressor.Block.BlockType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LiteralBlock(byte[] data, int offset, int length)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getData()` The literal data.
    `int` | `getLength()` Length of literal block.
    `int` | `getOffset()` Offset into data where the literal block starts.
    `LZ77Compressor.Block.BlockType` | `getType()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### LiteralBlock

          public LiteralBlock(byte[] data,
                              int offset,
                              int length)

  - ### Method Detail

    - #### getData

          public byte[] getData()

      The literal data.

      This returns a life view of the actual data in order to avoid copying, modify the array at your own risk.

      Returns:
        the data

    - #### getOffset

          public int getOffset()

      Offset into data where the literal block starts.
      Returns:
        the offset

    - #### getLength

          public int getLength()

      Length of literal block.
      Returns:
        the length

    - #### getType

          public LZ77Compressor.Block.BlockType getType()

      Specified by:
        `getType` in class `LZ77Compressor.Block`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.