Initializes a CborReader instance over the specified data with the given configuration.
The CBOR encoded data to read.
Private
#cachedPrivate
#currentPrivate
Readonly
#dataPrivate
#isPrivate
#nestedPrivate
#offsetPrivate
#advancePrivate
#advancePrivate
#ensurePrivate
#getPrivate
#peekPeeks the next initial byte without advancing the data stream.
The next initial byte.
Optional
expectedType: CborMajorTypeIf an expected type is given, the method will throw in the event of a major type mismatch.
Private
#peekPrivate
#peekReads the next CBOR token, without advancing the reader.
An object that represents the current CBOR reader state.
Private
#peekPeeks the core tag.
the Core tag and the bytes that would be consumed from the stream.
Private
#peekPrivate
#popGoes one level up on the stack.
The expected major type.
Private
#pushGoes one level down into the stack.
The current major type.
Optional
definiteLength: numberThe definite length of the current type (if applicable).
Private
#readReads the contents of a indefinite length bytearray or text and returns all the chunks concatenated.
The concatenated array.
The type of the indefinite array.
Private
#restoreRestores the stack after popping the current stack frame.
the stack frame.
Private
#skipPrivate
#validateReads the next CBOR token, without advancing the reader.
The current CBOR reader state.
Reads the next data item as a semantic tag (major type 6), without advancing the reader.
The decoded value.
Reads the next data item as a CBOR simple value (major type 7).
The decoded CBOR simple value.
Reads the next data item as the start of a map (major type 5).
The number of key-value pairs in a definite-length map, or null if the map is indefinite-length.
remark: Map contents are consumed as if they were arrays twice the length of the map's declared size.
For example, a map of size 1 containing a key of type int with a value of type string must be consumed by successive calls to readInt32 and readTextString.
Reads the next data item as a semantic tag (major type 6), without advancing the reader.
The decoded value.
Static
Private
#decodeDecodes an unsigned integer.
The header byte.
the data.
Static
Private
#peekPeeks the definite length for given data item.
An object with the definite length and the bytes read.
The initial byte header.
The data stream.
Static
Private
#peekPeeks the next initial byte without advancing the data stream.
The next initial byte.
the buffer where to get the initial byte from.
Optional
expectedType: CborMajorTypeIf an expected type is given, the method will throw in the event of a major type mismatch.
Static
ensureStatic
mapMaps simple value data to reader state.
The value.
Generated using TypeDoc
A stateful, forward-only reader for Concise Binary Object Representation (CBOR) encoded data.