ByteSequenceOutputs (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util.fst, class: ByteSequenceOutputs

Package org.apache.lucene.util.fst

# Class ByteSequenceOutputs

java.lang.Object
org.apache.lucene.util.fst.Outputs<BytesRef>
org.apache.lucene.util.fst.ByteSequenceOutputs

public final class ByteSequenceOutputs extends Outputs<BytesRef>
An FST `Outputs` implementation where each output is a sequence of bytes.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BytesRef`
  `add(BytesRef prefix, BytesRef output)`
  Eg add("foo", "bar") -> "foobar"
  `BytesRef`
  `common(BytesRef output1, BytesRef output2)`
  Eg common("foobar", "food") -> "foo"
  `BytesRef`
  `getNoOutput()`
  NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output
  `static ByteSequenceOutputs`
  `getSingleton()`
  `String`
  `outputToString(BytesRef output)`
  `long`
  `ramBytesUsed(BytesRef output)`
  Return memory usage for the provided output.
  `BytesRef`
  `read(DataInput in)`
  Decode an output value previously written with `Outputs.write(Object, DataOutput)`.
  `void`
  `skipOutput(DataInput in)`
  Skip the output; defaults to just calling `Outputs.read(org.apache.lucene.store.DataInput)` and discarding the result.
  `BytesRef`
  `subtract(BytesRef output, BytesRef inc)`
  Eg subtract("foobar", "foo") -> "bar"
  `String`
  `toString()`
  `void`
  `write(BytesRef prefix, DataOutput out)`
  Encode an output value into a `DataOutput`.

  ### Methods inherited from class org.apache.lucene.util.fst.Outputs

  `merge, readFinalOutput, skipFinalOutput, writeFinalOutput`

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

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

- ## Method Details

  - ### getSingleton

    public static ByteSequenceOutputs getSingleton()

  - ### common

    public BytesRef common(BytesRef output1, BytesRef output2)
    Description copied from class: `Outputs`
    Eg common("foobar", "food") -> "foo"
    Specified by:
      `common` in class `Outputs<BytesRef>`

  - ### subtract

    public BytesRef subtract(BytesRef output, BytesRef inc)
    Description copied from class: `Outputs`
    Eg subtract("foobar", "foo") -> "bar"
    Specified by:
      `subtract` in class `Outputs<BytesRef>`

  - ### add

    public BytesRef add(BytesRef prefix, BytesRef output)
    Description copied from class: `Outputs`
    Eg add("foo", "bar") -> "foobar"
    Specified by:
      `add` in class `Outputs<BytesRef>`

  - ### write

    public void write(BytesRef prefix, DataOutput out) throws IOException
    Description copied from class: `Outputs`
    Encode an output value into a `DataOutput`.
    Specified by:
      `write` in class `Outputs<BytesRef>`
    Throws:
      `IOException`

  - ### read

    public BytesRef read(DataInput in) throws IOException
    Description copied from class: `Outputs`
    Decode an output value previously written with `Outputs.write(Object, DataOutput)`.
    Specified by:
      `read` in class `Outputs<BytesRef>`
    Throws:
      `IOException`

  - ### skipOutput

    public void skipOutput(DataInput in) throws IOException
    Description copied from class: `Outputs`
    Skip the output; defaults to just calling `Outputs.read(org.apache.lucene.store.DataInput)` and discarding the result.
    Overrides:
      `skipOutput` in class `Outputs<BytesRef>`
    Throws:
      `IOException`

  - ### getNoOutput

    public BytesRef getNoOutput()
    Description copied from class: `Outputs`
    NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output
    Specified by:
      `getNoOutput` in class `Outputs<BytesRef>`

  - ### outputToString

    public String outputToString(BytesRef output)
    Specified by:
      `outputToString` in class `Outputs<BytesRef>`

  - ### ramBytesUsed

    public long ramBytesUsed(BytesRef output)
    Description copied from class: `Outputs`
    Return memory usage for the provided output.
    Specified by:
      `ramBytesUsed` in class `Outputs<BytesRef>`
    See Also:
      - `Accountable`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`