The Process
backing this StreamDecoder
.
The Process
backing this StreamDecoder
. All functions on StreamDecoder
are defined in terms of this Process.
Run this StreamDecoder
, then d
, then concatenate the two streams.
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.
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 Process[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 Process[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 Process[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 Process[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 Process[Task,A]
is finished being consumed.
If the acquire
and release
actions are asynchronous, use
decodeAsyncResource.
Ignore the first n
decoded values.
Ignore decoded values as long as the predicate tests true.
Modify the Process[Cursor,A]
backing this StreamDecoder
.
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.
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 Process[Cursor,B]
.
Alias for decode.isolate(numberOfBits)(this)
.
Alias for decode.isolateBytes(numberOfBytes)(this)
.
Run this StreamDecoder
zero 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
, converting left values
to decoding failures.
Raises a decoding error if the given decoder emits no results,
otherwise runs p
as normal.
Run this StreamDecoder
, then d
, then concatenate the two streams,
even if this
halts with an error.
Run this StreamDecoder
, then d
, then concatenate the two streams,
even if this
halts with an error. The error will be reraised when
d
completes. See scalaz.stream.Process.onComplete
.
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)
.
Transform the output of this StreamDecoder
using the given
single-input stream transducer.
Alternate between decoding A
values using this StreamDecoder
,
and decoding B
values which are ignored.
Create a strict (i.e., non-stream) decoder.
Decode at most n
values using this StreamDecoder
.
Decode values as long as the predicate tests true.
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.
Operator alias for this.or(d)
.
Alias for this pipe p
.
(Since version 1.7.0) Use widenOpt instead
A streaming decoding process, represented as a stream of state actions on scodec.bits.BitVector. Most clients will typically use one of the decoding convenience methods on this class, rather than using
decoder
directly.