decoder
BinaryDecoder
¶
Bases: ABC
Decodes bytes into Python physical primitives.
Source code in pyiceberg/avro/decoder.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
read(n)
abstractmethod
¶
read_boolean()
¶
Read a value from the stream as a boolean.
A boolean is written as a single byte whose value is either 0 (false) or 1 (true).
read_bytes()
¶
Bytes are encoded as a long followed by that many bytes of data.
read_double()
¶
Read a value from the stream as a double.
A double is written as 8 bytes. The double is converted into a 64-bit integer using a method equivalent to Java's doubleToLongBits and then encoded in little-endian format.
Source code in pyiceberg/avro/decoder.py
read_float()
¶
Read a value from the stream as a float.
A float is written as 4 bytes. The float is converted into a 32-bit integer using a method equivalent to Java's floatToIntBits and then encoded in little-endian format.
Source code in pyiceberg/avro/decoder.py
read_int()
¶
Read an int/long value.
int/long values are written using variable-length, zigzag coding.
Source code in pyiceberg/avro/decoder.py
read_int_bytes_dict(n, dest)
¶
Read a dictionary of integers for keys and bytes for values into a destination dictionary.
read_ints(n)
¶
read_utf8()
¶
Read an utf-8 encoded string from the stream.
A string is encoded as a long followed by that many bytes of UTF-8 encoded character data.
skip(n)
abstractmethod
¶
StreamingBinaryDecoder
¶
Bases: BinaryDecoder
Decodes bytes into Python physical primitives.
Source code in pyiceberg/avro/decoder.py
__init__(input_stream)
¶
Reader is a Python object on which we can call read, seek, and tell.
Source code in pyiceberg/avro/decoder.py
read(n)
¶
Read n bytes.