Decoder
| Modifier and Type | Field and Description |
|---|---|
| protected final AvroParserImpl |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public long | arrayNext()
Implements abstract org. Processes the next block of an array and returns the number of items in the block and let's the caller read those items. |
| protected JsonToken | Returns: The token that was consumed from the parserList of token types that is expected expectedTokens)Reads in the next value token from the parser and validates that it's one of the expected tokens |
| public long | mapNext()
Implements abstract org. Processes the next block of map entries and returns the count of them. |
| protected JsonToken | Returns: The next union branch tokenAdvance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted
by the parser for |
| protected JsonToken | Returns: The next data tokenAdvance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser for
|
| public long | readArrayStart()
Implements abstract org. Reads and returns the size of the first block of an array. |
| public boolean | readBoolean()
Implements abstract org. Reads a boolean value written by |
| public ByteBuffer | readBytes(ByteBuffer old)
Implements abstract org. Reads a byte-string written by |
| public double | readDouble()
Implements abstract org. Reads a double written by |
| 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. Reads fixed sized binary object. |
| public float | readFloat()
Implements abstract org. Reads a float written by |
| public int | readIndex()
Implements abstract org. Reads the tag of a union written by |
| public int | readInt()
Implements abstract org. Reads an integer written by |
| public long | readLong()
Implements abstract org. Reads a long written by |
| public long | readMapStart()
Implements abstract org. Reads and returns the size of the next block of map-entries. |
| public void | |
| public Utf8 | readString(Utf8 old)
Implements abstract org. Reads a char-string written by |
| public String | readString()
Implements abstract org. Reads a char-string written by |
| public long | skipArray()
Implements abstract org. Used for quickly skipping through an array. |
| public void | skipBytes()
Implements abstract org. Discards a byte-string written by |
| public void | skipFixed(int
The size of the binary object to be skipped. length)Implements abstract org. Discards fixed sized binary object. |
| public long | skipMap()
Implements abstract org. Support for quickly skipping through a map similar to |
| public void | skipString()
Implements abstract org. Discards a char-string written by |
| _parser | back to summary |
|---|---|
| protected final AvroParserImpl _parser | |
| DecoderOverAvroParser | back to summary |
|---|---|
| public DecoderOverAvroParser(AvroParserImpl parser) | |
| arrayNext | back to summary |
|---|---|
| public long arrayNext() throws IOException Implements abstract org. Doc from org. Processes the next block of an array and returns the number of items in the block and let's the caller read those items.
| |
| consumeToken | back to summary |
|---|---|
| protected JsonToken consumeToken(JsonToken... expectedTokens) throws IOException Reads in the next value token from the parser and validates that it's one of the expected tokens
| |
| mapNext | back to summary |
|---|---|
| public long mapNext() throws IOException Implements abstract org. Doc from org. Processes the next block of map entries and returns the count of them.
Similar to
| |
| nextUnionValue | back to summary |
|---|---|
| protected JsonToken nextUnionValue() throws IOException Advance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted
by the parser for
| |
| nextValue | back to summary |
|---|---|
| protected JsonToken nextValue() throws IOException Advance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser for
| |
| readArrayStart | back to summary |
|---|---|
| public long readArrayStart() throws IOException Implements abstract org. Doc from org. Reads and returns the size of the first block of an array. If this method
returns non-zero, then the caller should read the indicated number of items,
and then call
for(long i = in.readArrayStart(); i != 0; i = in.arrayNext()) {
for (long j = 0; j < i; j++) {
read next element of the array;
}
}
| |
| readBoolean | back to summary |
|---|---|
| public boolean readBoolean() throws IOException Implements abstract org. Doc from org. Reads a boolean value written by
| |
| readBytes | back to summary |
|---|---|
| public ByteBuffer readBytes(ByteBuffer old) throws IOException Implements abstract org. Doc from org. Reads a byte-string written by
| |
| readDouble | back to summary |
|---|---|
| public double readDouble() throws IOException Implements abstract org. Doc from org. Reads a double written by
| |
| readEnum | back to summary |
|---|---|
| public int readEnum() throws IOException Implements abstract org. Doc from org. Reads an enumeration.
| |
| readFixed | back to summary |
|---|---|
| public void readFixed(byte[] bytes, int start, int length) throws IOException Implements abstract org. Doc from org. Reads fixed sized binary object.
| |
| readFloat | back to summary |
|---|---|
| public float readFloat() throws IOException Implements abstract org. Doc from org. Reads a float written by
| |
| readIndex | back to summary |
|---|---|
| public int readIndex() throws IOException Implements abstract org. Doc from org. Reads the tag of a union written by
| |
| readInt | back to summary |
|---|---|
| public int readInt() throws IOException Implements abstract org. Doc from org. Reads an integer written by
| |
| readLong | back to summary |
|---|---|
| public long readLong() throws IOException Implements abstract org. Doc from org. Reads a long written by
| |
| readMapStart | back to summary |
|---|---|
| public long readMapStart() throws IOException Implements abstract org. Doc from org. Reads and returns the size of the next block of map-entries. Similar to
Map
| |
| readNull | back to summary |
|---|---|
| public void readNull() throws IOException Implements abstract org. Doc from org. "Reads" a null value. (Doesn't actually read anything, but advances the state of the parser if the implementation is stateful.)
| |
| readString | back to summary |
|---|---|
| public Utf8 readString(Utf8 old) throws IOException Implements abstract org. Doc from org. Reads a char-string written by
| |
| readString | back to summary |
|---|---|
| public String readString() throws IOException Implements abstract org. Doc from org. Reads a char-string written by
| |
| skipArray | back to summary |
|---|---|
| public long skipArray() throws IOException Implements abstract org. Doc from org. Used for quickly skipping through an array. Note you can either skip the
entire array, or read the entire array (with
for(long i = in.skipArray(); i != 0; i = i.skipArray()) {
for (long j = 0; j < i; j++) {
read and discard the next element of the array;
}
}
Note that this method can automatically skip through items if a byte-count is
found in the underlying data, or if a schema has been provided to the
implementation, but otherwise the client will have to skip through items
itself.
| |
| skipBytes | back to summary |
|---|---|
| public void skipBytes() throws IOException Implements abstract org. Doc from org. Discards a byte-string written by
| |
| skipFixed | back to summary |
|---|---|
| public void skipFixed(int length) throws IOException Implements abstract org. Doc from org. Discards fixed sized binary object.
| |
| skipMap | back to summary |
|---|---|
| public long skipMap() throws IOException Implements abstract org. Doc from org. Support for quickly skipping through a map similar to
for (long i = in.skipMap(); i != 0; i = in.skipMap()) {
for (long j = 0; j < i; j++) {
in.skipString(); // Discard key
in.readInt(); // Discard int-field of value
in.readBoolean(); // Discard boolean-field of value
}
}
| |
| skipString | back to summary |
|---|---|
| public void skipString() throws IOException Implements abstract org. Doc from org. Discards a char-string written by
| |