This class has two types of methods. One type of methods support the reading
of leaf values (for example, readLong and readString).
The other type of methods support the reading of maps and arrays. These
methods are readArrayStart, arrayNext, and similar methods
for maps). See readArrayStart for details on these methods.)
DecoderFactory contains Decoder construction and configuration
facilities.
DecoderFactory, Encoder
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract long | arrayNext()
Processes the next block of an array and returns the number of items in the block and let's the caller read those items. |
| public abstract long | |
| public abstract long | |
| public abstract boolean | |
| public abstract ByteBuffer | |
| public abstract double | |
| public abstract int | |
| public abstract 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)Reads fixed sized binary object. |
| public void | |
| public abstract float | |
| public abstract int | |
| public abstract int | |
| public abstract long | |
| public abstract long | |
| public abstract void | |
| public abstract Utf8 | |
| public abstract String | |
| public abstract long | |
| public abstract void | |
| public abstract void | skipFixed(int
The size of the binary object to be skipped. length)Discards fixed sized binary object. |
| public abstract long | |
| public abstract void |
| Decoder | back to summary |
|---|---|
| public Decoder() | |
| arrayNext | back to summary |
|---|---|
| public abstract long arrayNext() throws IOException Processes the next block of an array and returns the number of items in the block and let's the caller read those items.
| |
| mapNext | back to summary |
|---|---|
| public abstract long mapNext() throws IOException Processes the next block of map entries and returns the count of them.
Similar to
| |
| readArrayStart | back to summary |
|---|---|
| public abstract long readArrayStart() throws IOException 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 abstract boolean readBoolean() throws IOException Reads a boolean value written by
| |
| readBytes | back to summary |
|---|---|
| public abstract ByteBuffer readBytes(ByteBuffer old) throws IOException Reads a byte-string written by
| |
| readDouble | back to summary |
|---|---|
| public abstract double readDouble() throws IOException Reads a double written by
| |
| readEnum | back to summary |
|---|---|
| public abstract int readEnum() throws IOException Reads an enumeration.
| |
| readFixed | back to summary |
|---|---|
| public abstract void readFixed(byte[] bytes, int start, int length) throws IOException Reads fixed sized binary object.
| |
| readFixed | back to summary |
|---|---|
| public void readFixed(byte[] bytes) throws IOException A shorthand for readFixed(bytes, 0, bytes.length).
| |
| readFloat | back to summary |
|---|---|
| public abstract float readFloat() throws IOException Reads a float written by
| |
| readIndex | back to summary |
|---|---|
| public abstract int readIndex() throws IOException Reads the tag of a union written by
| |
| readInt | back to summary |
|---|---|
| public abstract int readInt() throws IOException Reads an integer written by
| |
| readLong | back to summary |
|---|---|
| public abstract long readLong() throws IOException Reads a long written by
| |
| readMapStart | back to summary |
|---|---|
| public abstract long readMapStart() throws IOException Reads and returns the size of the next block of map-entries. Similar to
Map
| |
| readNull | back to summary |
|---|---|
| public abstract void readNull() throws IOException "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 abstract Utf8 readString(Utf8 old) throws IOException Reads a char-string written by
| |
| readString | back to summary |
|---|---|
| public abstract String readString() throws IOException Reads a char-string written by
| |
| skipArray | back to summary |
|---|---|
| public abstract long skipArray() throws IOException 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 abstract void skipBytes() throws IOException Discards a byte-string written by
| |
| skipFixed | back to summary |
|---|---|
| public abstract void skipFixed(int length) throws IOException Discards fixed sized binary object.
| |
| skipMap | back to summary |
|---|---|
| public abstract long skipMap() throws IOException 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 abstract void skipString() throws IOException Discards a char-string written by
| |