Decoder for binary-format data.
Instances are created using DecoderFactory.
This class may read-ahead and buffer bytes from the source beyond what is required to serve its read methods. The number of unused bytes in the buffer can be accessed by inputStream().remaining(), if the BinaryDecoder is not 'direct'.
Encoder, SystemLimitException
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | BinaryDecoder.BufferAccessor
BufferAccessor is used by BinaryEncoder to enable |
| private static class | BinaryDecoder.ByteArrayByteSource
This byte source is special. |
| pack-priv abstract static class | BinaryDecoder.ByteSource
ByteSource abstracts the source of data from the core workings of BinaryDecoder. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private long | collectionCount
When reading a collection (MAP or ARRAY), this keeps track of the number of
elements to ensure that the
|
| private int | |
| private int | |
| private int | |
| private final Utf8 | |
| private BinaryDecoder. |
| Access | Constructor and Description |
|---|---|
| protected | |
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | arrayNext()
Implements abstract org. |
| pack-priv void | |
| pack-priv BinaryDecoder | |
| pack-priv BinaryDecoder | |
| private void | configureSource(int bufferSize, BinaryDecoder.
Initializes this decoder with a new ByteSource. |
| protected void | |
| protected long | |
| protected void | |
| private long | Returns: Zero if there are no more items to skip and end of array/map is reached. Positive number if some items are found that cannot be skipped and the client needs to skip them individually.Reads the count of items in the current array or map and skip those items, if possible. |
| private void | |
| pack-priv byte[] | |
| pack-priv int | |
| pack-priv int | |
| private long | |
| public InputStream | inputStream()
Returns an |
| public boolean | isEnd()
Returns true if the current BinaryDecoder is at the end of its source data and cannot read any further without throwing an EOFException or other IOException. |
| public long | mapNext()
Implements abstract org. |
| public long | readArrayStart()
Implements abstract org. |
| public boolean | readBoolean()
Implements abstract org. Encoder#writeBoolean.
|
| public ByteBuffer | readBytes(ByteBuffer old)
Implements abstract org. Encoder#writeBytes.
|
| public double | readDouble()
Implements abstract org. Encoder#writeDouble.
|
| public int | |
| public void | readFixed(byte[]
The buffer to store the contents being read. bytes, int The position where the data needs to be written. start, int The size of the binary object. length)Implements abstract org. |
| public float | readFloat()
Implements abstract org. Encoder#writeFloat.
|
| public int | readIndex()
Implements abstract org. Encoder#writeIndex.
|
| public int | readInt()
Implements abstract org. Encoder#writeInt.
|
| public long | readLong()
Implements abstract org. Encoder#writeLong.
|
| public long | readMapStart()
Implements abstract org. |
| public void | |
| public Utf8 | readString(Utf8 old)
Implements abstract org. Encoder#writeString.
|
| public String | readString()
Implements abstract org. Encoder#writeString.
|
| pack-priv void | |
| public long | skipArray()
Implements abstract org. |
| public void | skipBytes()
Implements abstract org. Encoder#writeBytes.
|
| public void | skipFixed(int
The size of the binary object to be skipped. length)Implements abstract org. |
| public long | skipMap()
Implements abstract org. skipArray.
|
| public void | skipString()
Implements abstract org. Encoder#writeString.
|