Package org.apache.lucene.util.encoding
Class IntDecoder
- java.lang.Object
-
- org.apache.lucene.util.encoding.IntDecoder
-
- Direct Known Subclasses:
DGapIntDecoder
,EightFlagsIntDecoder
,FourFlagsIntDecoder
,SimpleIntDecoder
,VInt8IntDecoder
public abstract class IntDecoder extends Object
Decodes integers from a setInputStream
. For re-usability, the decoder's input stream can be set by (reInit(InputStream)
). By design, Decoders are NOT thread-safe.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description static long
EOS
A special long value which is used to indicate end-of-stream has reached.protected InputStream
in
Input stream from which the encoded bytes are read
-
Constructor Summary
Constructors Constructor Description IntDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long
decode()
Decodes data received from the input stream, and returns one decoded integer.void
reInit(InputStream in)
Sets the input stream from which the encoded data is read.
-
-
-
Field Detail
-
EOS
public static final long EOS
A special long value which is used to indicate end-of-stream has reached.- See Also:
- Constant Field Values
-
in
protected InputStream in
Input stream from which the encoded bytes are read
-
-
Method Detail
-
reInit
public void reInit(InputStream in)
Sets the input stream from which the encoded data is read.
-
decode
public abstract long decode() throws IOException
Decodes data received from the input stream, and returns one decoded integer. If end of stream is reached,EOS
is returned.- Returns:
- one decoded integer as long or
EOS
if end-of-stream reached. - Throws:
IOException
- if an I/O error occurs
-
-