BlockEncoder (Lucene 10.5.0 codecs API)
Description: declaration: package: org.apache.lucene.codecs.uniformsplit, interface: BlockEncoder

Package org.apache.lucene.codecs.uniformsplit

# Interface BlockEncoder

public interface BlockEncoder
Encodes the raw bytes of a block when the index is written.

For example, implementations may compress or encrypt.

See Also:
  - `BlockDecoder`
WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `BlockEncoder.WritableBytes`
  Writable byte buffer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BlockEncoder.WritableBytes`
  `encode(DataInput blockBytes, long length)`
  Encodes all the bytes of one block in a single operation.

- ## Method Details

  - ### encode

    BlockEncoder.WritableBytes encode(DataInput blockBytes, long length) throws IOException
    Encodes all the bytes of one block in a single operation. The encoding is per block.
    Parameters:
      `blockBytes` - The input block bytes to read.
      `length` - The number of bytes to read from the input.
    Returns:
      The encoded block bytes.
    Throws:
      `IOException` - If an encoding error occurs.