package scodec
- Alphabetic
- Public
- Protected
Type Members
- final case class CodecError(err: Err) extends Exception with Product with Serializable
Lifts an
scodec.Errin to an exception. - final class StreamDecoder[+A] extends AnyRef
Supports binary decoding of a stream that emits elements as they are decoded.
Supports binary decoding of a stream that emits elements as they are decoded.
The main purpose of using a
StreamDecoderover ascodec.Decoderis mixing decoding with processing. For example,scodec.codecs.vector(decoderA): Decoder[Vector[A]]could be used to decode a bit stream but the decodedVector[A]would not be emitted until the end of the bit stream. WithStreamDecoder.many(decoderA): StreamDecoder[A], each decodedAvalue is emitted as soon as it is decoded.The
StreamDecodercompanion has various constructors -- most importantly,onceandmany, that allow aDecoder[A]to be lifted to aStreamDecoder[A].Given a
StreamDecoder[A], a bit stream can be decoded via thedecodemethod or by calling a variant oftoPipe. - final class StreamEncoder[A] extends AnyRef
A streaming encoding process, represented as a
Stream[Pure, A] => Pull[Pure, BitVector, Option[(Stream[Pure, A], StreamEncoder[A])]].
Value Members
- object StreamDecoder
- object StreamEncoder