Package org.apache.lucene.util.encoding
Class SimpleIntEncoder
- java.lang.Object
-
- org.apache.lucene.util.encoding.IntEncoder
-
- org.apache.lucene.util.encoding.SimpleIntEncoder
-
public class SimpleIntEncoder extends IntEncoder
A simpleIntEncoder
, writing an integer as 4 raw bytes. *- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.util.encoding.IntEncoder
out
-
-
Constructor Summary
Constructors Constructor Description SimpleIntEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntDecoder
createMatchingDecoder()
Returns anIntDecoder
which matches this encoder.void
encode(int value)
This method makes sure the value wasn't previously encoded by checking against the Set.String
toString()
-
Methods inherited from class org.apache.lucene.util.encoding.IntEncoder
close, reInit
-
-
-
-
Method Detail
-
encode
public void encode(int value) throws IOException
This method makes sure the value wasn't previously encoded by checking against the Set. If the value wasn't encoded, it's added to the Set, and encoded with {#link Vint8#encode}- Specified by:
encode
in classIntEncoder
- Parameters:
value
- an integer to be encoded- Throws:
IOException
- possibly thrown by the OutputStream
-
createMatchingDecoder
public IntDecoder createMatchingDecoder()
Description copied from class:IntEncoder
Returns anIntDecoder
which matches this encoder. Every encoder must return anIntDecoder
andnull
is not a valid value. If an encoder is just a filter, it should at least return its wrapped encoder's matching decoder.NOTE: this method should create a new instance of the matching decoder and leave the instance sharing to the caller. Returning the same instance over and over is risky because encoders and decoders are not thread safe.
- Specified by:
createMatchingDecoder
in classIntEncoder
-
-