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 IntDecodercreateMatchingDecoder()Returns anIntDecoderwhich matches this encoder.voidencode(int value)This method makes sure the value wasn't previously encoded by checking against the Set.StringtoString()-
Methods inherited from class org.apache.lucene.util.encoding.IntEncoder
close, reInit
-
-
-
-
Method Detail
-
encode
public void encode(int value) throws IOExceptionThis 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:
encodein classIntEncoder- Parameters:
value- an integer to be encoded- Throws:
IOException- possibly thrown by the OutputStream
-
createMatchingDecoder
public IntDecoder createMatchingDecoder()
Description copied from class:IntEncoderReturns anIntDecoderwhich matches this encoder. Every encoder must return anIntDecoderandnullis 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:
createMatchingDecoderin classIntEncoder
-
-