Package 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.AbstractReference
org.apache.commons.compress.compressors.lz77support.LZ77Compressor.LiteralBlock

Enclosing class:
  `LZ77Compressor`

public static final class LZ77Compressor.LiteralBlock extends LZ77Compressor.AbstractReference
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
  Description
  `LiteralBlock(byte[] data, int offset, int length)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getData()`
  Gets the literal data.

  ### Methods inherited from class org.apache.commons.compress.compressors.lz77support.LZ77Compressor.AbstractReference

  `getLength, getOffset, toString`

  ### Methods inherited from class org.apache.commons.compress.compressors.lz77support.LZ77Compressor.Block

  `getType`

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

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

- ## Constructor Details

  - ### LiteralBlock

    public LiteralBlock(byte[] data, int offset, int length)
    Constructs a new instance.
    Parameters:
      `data` - the literal data.
      `offset` - the length of literal block.
      `length` - the length of literal block.

- ## Method Details

  - ### getData

    public byte[] getData()
    Gets the literal data.

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

    Returns:
      the data