Class Decoder

Low-level support for de-serializing Avro values.

class Decoder ;

This class has two types of methods. One type of methods support the reading of leaf values (for example, [Decoder.readLong] and [Decoder.readString]).

The other type of methods support the reading of maps and arrays. These methods are [Decoder.readArrayStart], [Decoder.arrayNext], and similar methods for maps. See [Decoder.readArrayStart] for details on these methods.

Methods

NameDescription
readArrayNext () Processes the next block of an array and returns the number of items in the block and let's the caller read those items.
readArrayStart () 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 [arrayNext] to find out the number of items in the next block. The typical pattern for consuming an array looks like:
readBoolean () Reads a boolean value written by [Encoder.writeBoolean].
readBytes () Reads a byte-string written by [Encoder.writeBytes]. if old is not null and has sufficient capacity to take in the bytes being read, the bytes are returned in old.
readDouble () Reads a double written by [Encoder.writeDouble].
readEnum (enumSchema) Reads an enumeration.
readFixed (length) Reads fixed sized binary object.
readFloat () Reads a float written by [Encoder.writeFloat].
readInt () Reads an integer written by [Encoder.writeInt].
readLong () Reads a long written by [Encoder.writeLong].
readMapNext () Processes the next block of map entries and returns the count of them. Similar to [arrayNext]. See [readMapStart] for details.
readMapStart () Reads and returns the size of the next block of map-entries. Similar to [readArrayStart].
readNull () "Reads" a null value. (Doesn't actually read anything, but advances the state of the parser if the implementation is stateful.)
readString () Reads a char-string written by [Encoder.writeString].
readUnionEnd ()
readUnionIndex (unionSchema) Reads the tag of a union written by [Encoder.writeIndex].
skipArray () Used for quickly skipping through an array. Note you can either skip the entire array, or read the entire array (with [readArrayStart]), but you can't mix the two on the same array.
skipBytes () Discards a byte-string written by [Encoder.writeBytes].
skipFixed (length) Discards fixed sized binary object.
skipMap () Support for quickly skipping through a map similar to [skipArray].
skipString () Discards a char-string written by [Encoder.writeString].