The Stream
backing this StreamDecoder
.
The Stream
backing this StreamDecoder
. All functions on StreamDecoder
are defined in terms of this Stream
.
Run this StreamDecoder
, then d
, then concatenate the two streams.
Run this StreamDecoder
, then d
, then concatenate the two streams.
Run this StreamEncoder
, followed by e
.
Run this StreamEncoder
, followed by e
.
Transform the output of this StreamDecoder
using the partial function pf
.
Transform the output of this StreamDecoder
using the partial function pf
.
Decoding a stream of A
values from the given BitVector
.
Decoding a stream of A
values from the given BitVector
.
This function does not retain a reference to bits
, allowing
it to be be garbage collected as the returned stream is traversed.
Decode the given BitVector
, returning a strict Vector
of
the results, and throwing an exception in the event of a
decoding error.
Decode the given BitVector
, returning a strict Vector
of
the results, and throwing an exception in the event of a
decoding error.
Resource-safe version of decode
.
Resource-safe version of decode
. Acquires a resource,
decodes a stream of values, and releases the resource when
the returned Stream[Task,A]
is finished being consumed.
The acquire
and release
actions may be asynchronous.
Resource-safe version of decode
for a ReadableByteChannel
resource.
Resource-safe version of decode
for a ReadableByteChannel
resource.
This is just a convenience function which calls decodeResource, using
scodec.bits.BitVector.fromChannel
as the read
function, and which
closes in
after the returned Stream[Task,A]
is consumed.
Resource-safe version of decode
for an InputStream
resource.
Resource-safe version of decode
for an InputStream
resource.
This is just a convenience function which calls decodeResource, using
scodec.bits.BitVector.fromInputStream
as the read
function, and which
closes in
after the returned Stream[Task,A]
is consumed.
Resource-safe version of decode
for a ReadableByteChannel
resource.
Resource-safe version of decode
for a ReadableByteChannel
resource.
This is just a convenience function which calls decodeResource, using
scodec.bits.BitVector.fromChannel
as the read
function, and which
closes in
after the returned Stream[Task,A]
is consumed.
Resource-safe version of decode
.
Resource-safe version of decode
. Acquires a resource,
decodes a stream of values, and releases the resource when
the returned Stream[Task,A]
is finished being consumed.
If the acquire
and release
actions are asynchronous, use
decodeAsyncResource.
Ignore the first n
decoded values.
Ignore the first n
decoded values.
Ignore decoded values as long as the predicate tests true.
Ignore decoded values as long as the predicate tests true.
Modify the Stream[Cursor,A]
backing this StreamDecoder
.
Modify the Stream[Cursor,A]
backing this StreamDecoder
.
Modify the Pull
backing this StreamEncoder
.
Modify the Pull
backing this StreamEncoder
.
Encode the input stream of A
values using this StreamEncoder
.
Encode the input stream of A
values using this StreamEncoder
.
Encode the given sequence of A
values to a BitVector
, raising an exception
in the event of an encoding error.
Encode the given sequence of A
values to a BitVector
, raising an exception
in the event of an encoding error.
Skip any decoded values for which the predicate tests false.
Skip any decoded values for which the predicate tests false.
Equivalent to dropWhile(f).take(1)
- returns a stream of (at most)
one element, consisting of the first output for which f
tests false.
Equivalent to dropWhile(f).take(1)
- returns a stream of (at most)
one element, consisting of the first output for which f
tests false.
Monadic bind for this StreamDecoder
.
Monadic bind for this StreamDecoder
. Runs a stream decoder for each A
produced by this StreamDecoder
, then concatenates all the resulting
streams of results. This is the same 'idea' as List.flatMap
.
Like flatMap
, but takes a function that produces a Stream[Cursor,B]
.
Like flatMap
, but takes a function that produces a Stream[Cursor,B]
.
Promote to a StreamCodec[O]
given evidence that I
and O
are equal.
Promote to a StreamCodec[O]
given evidence that I
and O
are equal.
Alias for decode.isolate(numberOfBits)(this)
.
Alias for decode.isolate(numberOfBits)(this)
.
Alias for decode.isolateBytes(numberOfBytes)(this)
.
Alias for decode.isolateBytes(numberOfBytes)(this)
.
Run this StreamDecoder
zero or more times until the input is exhausted.
Run this StreamDecoder
zero or more times until the input is exhausted.
Run this StreamDecoder
one or more times until the input is exhausted.
Run this StreamDecoder
one or more times until the input is exhausted.
Transform the output of this StreamDecoder
using the function f
.
Transform the output of this StreamDecoder
using the function f
.
Transform the output of this StreamDecoder
, converting left values
to decoding failures.
Transform the output of this StreamDecoder
, converting left values
to decoding failures.
Raises a decoding error if the given decoder emits no results,
otherwise runs s
as normal.
Raises a decoding error if the given decoder emits no results,
otherwise runs s
as normal.
Alias for scodec.stream.decode.or(this,d)
.
Alias for scodec.stream.decode.or(this,d)
.
Runs this
, then runs d
if this
emits no elements.
Example: tryOnce(codecs.int32).or(once(codecs.uint32))
.
This function does no backtracking of its own; any desired
backtracking should be handled by this
.
Alias for scodec.stream.decode.peek(this)
.
Alias for scodec.stream.decode.peek(this)
.
Alternate between decoding A
values using this StreamDecoder
,
and decoding B
values which are ignored.
Alternate between decoding A
values using this StreamDecoder
,
and decoding B
values which are ignored.
Create a strict (i.e., non-stream) decoder.
Create a strict (i.e., non-stream) decoder.
Decode at most n
values using this StreamDecoder
.
Decode at most n
values using this StreamDecoder
.
Decode values as long as the predicate tests true.
Decode values as long as the predicate tests true.
Transform the output of this StreamDecoder
using the given
single-input stream transducer.
Transform the output of this StreamDecoder
using the given
single-input stream transducer.
Combine the output of this StreamDecoder
with another streaming
decoder, using the given binary stream transducer.
Combine the output of this StreamDecoder
with another streaming
decoder, using the given binary stream transducer. Note that both
d
and this
will operate on the same input BitVector
, so this
combinator is more useful for expressing alternation between two
decoders.
Skip any decoded values for which the predicate tests false.
Skip any decoded values for which the predicate tests false.
Transform the input type of this StreamEncoder
.
Transform the input type of this StreamEncoder
.
Operator alias for this.or(d)
.
Operator alias for this.or(d)
.
(streamCodec: TransformSyntax[StreamCodec, A]).xmapc(f)(g)
(Since version 1.7.0) Use widenOpt instead