package high
High-level representation and tools for CBOR data streams.
The high-level representation is less powerful as the low-level one, as it builds
structured data. For instance it is not able to represent arrays of strings whose size
is bigger than Int.MaxValue
.
The reprensentation is intended to be easier to work with if you need more structured data and don't exceed the underlying limits.
- Alphabetic
- By Inheritance
- high
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def parseValues[F[_]](implicit F: RaiseThrowable[F]): Pipe[F, CborItem, CborValue]
Parses the stream of low-level items into high level AST.
- def toBinary[F[_]]: Pipe[F, CborValue, Byte]
Transforms a stream of CBOR values into the binary representations.
Transforms a stream of CBOR values into the binary representations.
This encoder, uses some tags defined in Tags to encode some values (e.g. big numbers).
- def toItems[F[_]]: Pipe[F, CborValue, CborItem]
Transforms a stream of CBOR values into a stream of low-level items.
Transforms a stream of CBOR values into a stream of low-level items.
This encoder, uses some tags defined in Tags to encode some values (e.g. big numbers).
- def values[F[_]](implicit F: RaiseThrowable[F]): Pipe[F, Byte, CborValue]
Parses the stream of bytes into high level AST.
- object CborValue
- object HalfFloat
HalfFloat represents 16-bit floating-point values.
HalfFloat represents 16-bit floating-point values.
This type does not actually support arithmetic directly. The expected use case is to convert to Float to perform any actual arithmetic, then convert back to a HalfFloat if needed.
Binary representation:
sign (1 bit) | | exponent (5 bits) | | | | mantissa (10 bits) | | | x xxxxx xxxxxxxxxx
Value interpretation (in order of precedence, with _ wild):
0 00000 0000000000 (positive) zero 1 00000 0000000000 negative zero _ 00000 subnormal number _ 11111 0000000000 +/- infinity _ 11111 not-a-number _ _ normal number
For non-zero exponents, the mantissa has an implied leading 1 bit, so 10 bits of data provide 11 bits of precision for normal numbers.