Class GorillaDecoderV2
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.decoder.Decoder
-
- org.apache.iotdb.tsfile.encoding.decoder.GorillaDecoderV2
-
- Direct Known Subclasses:
IntChimpDecoder,IntGorillaDecoder,LongChimpDecoder,LongGorillaDecoder
public abstract class GorillaDecoderV2 extends Decoder
This class includes code modified from Michael Burman's gorilla-tsc project.Copyright: 2016-2018 Michael Burman and/or other contributors
Project page: https://github.com/burmanm/gorilla-tsc
License: http://www.apache.org/licenses/LICENSE-2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanfirstValueWasReadprotected booleanhasNextprotected intstoredLeadingZerosprotected intstoredTrailingZeros
-
Constructor Summary
Constructors Modifier Constructor Description protectedGorillaDecoderV2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidflipByte(java.nio.ByteBuffer in)booleanhasNext(java.nio.ByteBuffer in)protected booleanreadBit(java.nio.ByteBuffer in)Reads the next bit and returns a boolean representing it.protected longreadLong(int bits, java.nio.ByteBuffer in)Reads a long from the next X bits that represent the least significant bits in the long value.protected bytereadNextClearBit(int maxBits, java.nio.ByteBuffer in)voidreset()-
Methods inherited from class org.apache.iotdb.tsfile.encoding.decoder.Decoder
getDecoderByType, getType, readBigDecimal, readBinary, readBoolean, readDouble, readFloat, readInt, readLong, readShort, setType
-
-
-
-
Method Detail
-
hasNext
public final boolean hasNext(java.nio.ByteBuffer in)
-
readBit
protected boolean readBit(java.nio.ByteBuffer in)
Reads the next bit and returns a boolean representing it.- Returns:
- true if the next bit is 1, otherwise 0.
-
readLong
protected long readLong(int bits, java.nio.ByteBuffer in)Reads a long from the next X bits that represent the least significant bits in the long value.- Parameters:
bits- How many next bits are read from the stream- Returns:
- long value that was read from the stream
-
readNextClearBit
protected byte readNextClearBit(int maxBits, java.nio.ByteBuffer in)
-
flipByte
protected void flipByte(java.nio.ByteBuffer in)
-
-