package low
Low-level representation and tools for CBOR data streams.
The low-level representation has two main goals:
- it is a flat representation of the input stream, which allows for
expressing collections that exceed the max size of
Int.MaxValue
- it doesn't interpret numbers, keeping their raw representation in memory.
This representation is useful when dealing with streams that may contain big collections or when it is not necessary to build an AST, as it is more efficient than the high-level one.
The data model follows closely the structure described in the RFC.
- Source
- package.scala
- Alphabetic
- By Inheritance
- low
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Value Members
- def items[F[_]](implicit F: RaiseThrowable[F]): Pipe[F, Byte, CborItem]
Parses the input byte stream into a sequence of low-level CBOR items.
Parses the input byte stream into a sequence of low-level CBOR items. This allows for parsing arbitrary long and deep CBOR data. No AST is built.
- def toBinary[F[_]](implicit F: RaiseThrowable[F]): Pipe[F, CborItem, Byte]
Transforms a stream of CBOR items into the binary representation.
Transforms a stream of CBOR items into the binary representation.
The resulting stream fails as soon as a problem is encounter.
- def toNonValidatedBinary[F[_]]: Pipe[F, CborItem, Byte]
Transforms a stream of CBOR items into the binary representation.
Transforms a stream of CBOR items into the binary representation.
This produces a valid byte stream if the input item stream is well-formed, otherwise result is uncertain and will eventually produce an invalid byte sequence.
Use this pipe if you are sure the stream is well-formed or if it does not matter to produce ill-formed streams.
Since no validation is performed, this pipe is more efficient and allows for better throughput.
- def validate[F[_]](implicit F: RaiseThrowable[F]): Pipe[F, CborItem, CborItem]
Validates the stream of CBOR items, emitting them unchanged.
Validates the stream of CBOR items, emitting them unchanged.
The resulting stream is failed as soon as a problem is encountered.
- object CborItem