Class GorillaDecoderV1
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.decoder.Decoder
-
- org.apache.iotdb.tsfile.encoding.decoder.GorillaDecoderV1
-
- Direct Known Subclasses:
DoublePrecisionDecoderV1,SinglePrecisionDecoderV1
public abstract class GorillaDecoderV1 extends Decoder
-
-
Field Summary
Fields Modifier and Type Field Description protected intbufferprotected static intEOFprotected booleanflagprotected booleanisEndprotected intleadingZeroNumprotected booleannextFlag1protected booleannextFlag2protected intnumberLeftInBufferprotected inttailingZeroNum
-
Constructor Summary
Constructors Modifier Constructor Description protectedGorillaDecoderV1()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfillBuffer(java.nio.ByteBuffer buffer)read one byte and save it in the buffer.booleanhasNext(java.nio.ByteBuffer buffer)protected booleanisEmpty()protected booleanreadBit(java.nio.ByteBuffer buffer)protected intreadIntFromStream(java.nio.ByteBuffer buffer, int len)read some bits and convert them to an int value.protected longreadLongFromStream(java.nio.ByteBuffer buffer, int len)read some bits and convert them to a long value.voidreset()-
Methods inherited from class org.apache.iotdb.tsfile.encoding.decoder.Decoder
getDecoderByType, getType, readBigDecimal, readBinary, readBoolean, readDouble, readFloat, readInt, readLong, readShort, setType
-
-
-
-
Field Detail
-
EOF
protected static final int EOF
- See Also:
- Constant Field Values
-
flag
protected boolean flag
-
leadingZeroNum
protected int leadingZeroNum
-
tailingZeroNum
protected int tailingZeroNum
-
isEnd
protected boolean isEnd
-
buffer
protected int buffer
-
numberLeftInBuffer
protected int numberLeftInBuffer
-
nextFlag1
protected boolean nextFlag1
-
nextFlag2
protected boolean nextFlag2
-
-
Method Detail
-
hasNext
public boolean hasNext(java.nio.ByteBuffer buffer) throws java.io.IOException
-
isEmpty
protected boolean isEmpty()
-
readBit
protected boolean readBit(java.nio.ByteBuffer buffer) throws java.io.IOException- Throws:
java.io.IOException
-
fillBuffer
protected void fillBuffer(java.nio.ByteBuffer buffer)
read one byte and save it in the buffer.- Parameters:
buffer- ByteBuffer to read
-
readIntFromStream
protected int readIntFromStream(java.nio.ByteBuffer buffer, int len) throws java.io.IOExceptionread some bits and convert them to an int value.- Parameters:
buffer- stream to readlen- number of bit to read- Returns:
- converted int value
- Throws:
java.io.IOException- cannot read from stream
-
readLongFromStream
protected long readLongFromStream(java.nio.ByteBuffer buffer, int len) throws java.io.IOExceptionread some bits and convert them to a long value.- Parameters:
buffer- stream to readlen- number of bit to read- Returns:
- converted long value
- Throws:
java.io.IOException- cannot read from stream
-
-