| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.util.encoding.cbor.CborDecoder |
Provides a decoder capable of handling CBOR encoded data from a InputStream.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| protected final PushbackInputStream | m_is | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
CborDecoder(InputStream is)
Creates a new
CborDecoder instance. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CborType |
peekType()
Peeks in the input stream for the upcoming type.
| ||||||||||
| long |
readArrayLength()
Prolog to reading an array value in CBOR format.
| ||||||||||
| boolean |
readBoolean()
Reads a boolean value in CBOR format.
| ||||||||||
| Object |
readBreak()
Reads a "break"/stop value in CBOR format.
| ||||||||||
| byte[] |
readByteString()
Reads a byte string value in CBOR format.
| ||||||||||
| long |
readByteStringLength()
Prolog to reading a byte string value in CBOR format.
| ||||||||||
| double |
readDouble()
Reads a double-precision float value in CBOR format.
| ||||||||||
| float |
readFloat()
Reads a single-precision float value in CBOR format.
| ||||||||||
| double |
readHalfPrecisionFloat()
Reads a half-precision float value in CBOR format.
| ||||||||||
| long |
readInt()
Reads a signed or unsigned integer value in CBOR format.
| ||||||||||
| int |
readInt16()
Reads a signed or unsigned 16-bit integer value in CBOR format.
| ||||||||||
| long |
readInt32()
Reads a signed or unsigned 32-bit integer value in CBOR format.
| ||||||||||
| long |
readInt64()
Reads a signed or unsigned 64-bit integer value in CBOR format.
| ||||||||||
| int |
readInt8()
Reads a signed or unsigned 8-bit integer value in CBOR format.
| ||||||||||
| long |
readMapLength()
Prolog to reading a map of key-value pairs in CBOR format.
| ||||||||||
| Object |
readNull()
Reads a
null-value in CBOR format. | ||||||||||
| byte |
readSimpleValue()
Reads a single byte value in CBOR format.
| ||||||||||
| int |
readSmallInt()
Reads a signed or unsigned small (<= 23) integer value in CBOR format.
| ||||||||||
| long |
readTag()
Reads a semantic tag value in CBOR format.
| ||||||||||
| String |
readTextString()
Reads an UTF-8 encoded string value in CBOR format.
| ||||||||||
| long |
readTextStringLength()
Prolog to reading an UTF-8 encoded string value in CBOR format.
| ||||||||||
| Object |
readUndefined()
Reads an undefined value in CBOR format.
| ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| long |
expectIntegerType(int ib)
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectation.
| ||||||||||
| int |
readMajorType(int majorType)
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectation.
| ||||||||||
| void |
readMajorTypeExact(int majorType, int subtype)
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectations.
| ||||||||||
| long |
readMajorTypeWithSize(int majorType)
Reads the next major type from the underlying input stream, verifies whether it matches the given expectation, and decodes the payload into a size.
| ||||||||||
| long |
readUInt(int length, boolean breakAllowed)
Reads an unsigned integer with a given length-indicator.
| ||||||||||
| int |
readUInt16()
Reads an unsigned 16-bit integer value
| ||||||||||
| long |
readUInt32()
Reads an unsigned 32-bit integer value
| ||||||||||
| long |
readUInt64()
Reads an unsigned 64-bit integer value
| ||||||||||
| int |
readUInt8()
Reads an unsigned 8-bit integer value
| ||||||||||
| long |
readUIntExact(int expectedLength, int length)
Reads an unsigned integer with a given length-indicator.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Creates a new CborDecoder instance.
| is | the actual input stream to read the CBOR-encoded data from, cannot be null.
|
|---|
Peeks in the input stream for the upcoming type.
null in case of an end-of-stream.| IOException | in case of I/O problems reading the CBOR-type from the underlying input stream. |
|---|
Prolog to reading an array value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a boolean value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a "break"/stop value in CBOR format.
null.| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a byte string value in CBOR format.
null. In case the encoded string has a length of 0, an empty string is returned.| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Prolog to reading a byte string value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a signed or unsigned 16-bit integer value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying output stream. |
|---|
Reads a signed or unsigned 32-bit integer value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying output stream. |
|---|
Reads a signed or unsigned 64-bit integer value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying output stream. |
|---|
Reads a signed or unsigned 8-bit integer value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying output stream. |
|---|
Prolog to reading a map of key-value pairs in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a null-value in CBOR format.
null.| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a single byte value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads a signed or unsigned small (<= 23) integer value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying output stream. |
|---|
Reads a semantic tag value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads an UTF-8 encoded string value in CBOR format.
null. In case the encoded string has a length of 0, an empty string is returned.| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Prolog to reading an UTF-8 encoded string value in CBOR format.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads an undefined value in CBOR format.
null.| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectation.
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectation.
| majorType | the expected major type, cannot be null (unchecked). |
|---|
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads the next major type from the underlying input stream, and verifies whether it matches the given expectations.
| majorType | the expected major type, cannot be null (unchecked); |
|---|---|
| subtype | the expected subtype. |
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads the next major type from the underlying input stream, verifies whether it matches the given expectation, and decodes the payload into a size.
| majorType | the expected major type, cannot be null (unchecked). |
|---|
| IOException | in case of I/O problems reading the CBOR-encoded value from the underlying input stream. |
|---|
Reads an unsigned integer with a given length-indicator.
| length | the length indicator to use; |
|---|
| IOException | in case of I/O problems reading the unsigned integer from the underlying input stream. |
|---|
Reads an unsigned integer with a given length-indicator.
| length | the length indicator to use; |
|---|
| IOException | in case of I/O problems reading the unsigned integer from the underlying input stream. |
|---|