trait StreamDecoder[+A] extends AnyRef
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.
- Self Type
- StreamDecoder[A]
- Source
- StreamDecoder.scala
- Alphabetic
- By Inheritance
- StreamDecoder
- AnyRef
- Any
- by TransformSyntax
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to any2stringadd[StreamDecoder[A]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
final
def
++[A2 >: A](d: ⇒ StreamDecoder[A2]): StreamDecoder[A2]
Run this
StreamDecoder, thend, then concatenate the two streams. -
def
->[B](y: B): (StreamDecoder[A], B)
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to ArrowAssoc[StreamDecoder[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
as[B](implicit as: Transformer[A, B]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
collect[B](pf: PartialFunction[A, B]): StreamDecoder[B]
Transform the output of this
StreamDecoderusing the partial functionpf. -
final
def
decode[F[_]](bits: ⇒ BitVector)(implicit F: Effect[F]): Stream[F, A]
Decoding a stream of
Avalues from the givenBitVector.Decoding a stream of
Avalues from the givenBitVector. This function does not retain a reference tobits, allowing it to be be garbage collected as the returned stream is traversed. -
def
decodeAllValid(bits: ⇒ BitVector): Vector[A]
Decode the given
BitVector, returning a strictVectorof the results, and throwing an exception in the event of a decoding error. -
final
def
decodeAsyncResource[F[_], R](acquire: F[R])(read: (R) ⇒ BitVector, release: (R) ⇒ F[Unit])(implicit arg0: Effect[F]): Stream[F, A]
Resource-safe version of
decode.Resource-safe version of
decode. Acquires a resource, decodes a stream of values, and releases the resource when the returnedStream[F,A]is finished being consumed. Theacquireandreleaseactions may be asynchronous. -
final
def
decodeChannel[F[_]](in: ⇒ ReadableByteChannel, chunkSizeInBytes: Int = 1024 * 1000 * 16, direct: Boolean = false)(implicit arg0: Effect[F]): Stream[F, A]
Resource-safe version of
decodefor aReadableByteChannelresource.Resource-safe version of
decodefor aReadableByteChannelresource. This is just a convenience function which calls decodeResource, usingscodec.bits.BitVector.fromChannelas thereadfunction, and which closesinafter the returnedStream[F,A]is consumed. -
final
def
decodeInputStream[F[_]](in: ⇒ InputStream, chunkSizeInBytes: Int = 1024 * 1000 * 16)(implicit arg0: Effect[F]): Stream[F, A]
Resource-safe version of
decodefor anInputStreamresource.Resource-safe version of
decodefor anInputStreamresource. This is just a convenience function which calls decodeResource, usingscodec.bits.BitVector.fromInputStreamas thereadfunction, and which closesinafter the returnedStream[F,A]is consumed. -
final
def
decodeMmap[F[_]](in: ⇒ FileChannel, chunkSizeInBytes: Int = 1024 * 1000 * 16)(implicit arg0: Effect[F]): Stream[F, A]
Resource-safe version of
decodefor aReadableByteChannelresource.Resource-safe version of
decodefor aReadableByteChannelresource. This is just a convenience function which calls decodeResource, usingscodec.bits.BitVector.fromChannelas thereadfunction, and which closesinafter the returnedStream[F,A]is consumed. -
final
def
decodeResource[F[_], R](acquire: ⇒ R)(read: (R) ⇒ BitVector, release: (R) ⇒ Unit)(implicit F: Effect[F]): Stream[F, A]
Resource-safe version of
decode.Resource-safe version of
decode. Acquires a resource, decodes a stream of values, and releases the resource when the returnedStream[F,A]is finished being consumed. If theacquireandreleaseactions are asynchronous, use decodeAsyncResource. -
def
drop(n: Long): StreamDecoder[A]
Ignore the first
ndecoded values. -
def
dropWhile(f: (A) ⇒ Boolean): StreamDecoder[A]
Ignore decoded values as long as the predicate tests true.
-
final
def
edit[B](f: (Stream[Cursor, A]) ⇒ Stream[Cursor, B]): StreamDecoder[B]
Modify the
Stream[Cursor,A]backing thisStreamDecoder. -
def
ensuring(cond: (StreamDecoder[A]) ⇒ Boolean, msg: ⇒ Any): StreamDecoder[A]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to Ensuring[StreamDecoder[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (StreamDecoder[A]) ⇒ Boolean): StreamDecoder[A]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to Ensuring[StreamDecoder[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): StreamDecoder[A]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to Ensuring[StreamDecoder[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): StreamDecoder[A]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to Ensuring[StreamDecoder[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exmap[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ Attempt[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
exmapc[B](f: (A) ⇒ Attempt[B])(g: (B) ⇒ Attempt[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
filter(f: (A) ⇒ Boolean): StreamDecoder[A]
Skip any decoded values for which the predicate tests false.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
firstAfter(f: (A) ⇒ Boolean): StreamDecoder[A]
Equivalent to
dropWhile(f).take(1)- returns a stream of (at most) one element, consisting of the first output for whichftests false. -
final
def
flatMap[B](f: (A) ⇒ StreamDecoder[B]): StreamDecoder[B]
Monadic bind for this
StreamDecoder.Monadic bind for this
StreamDecoder. Runs a stream decoder for eachAproduced by thisStreamDecoder, then concatenates all the resulting streams of results. This is the same 'idea' asList.flatMap. -
final
def
flatMapS[B](f: (A) ⇒ Stream[Cursor, B]): StreamDecoder[B]
Like
flatMap, but takes a function that produces aStream[Cursor,B]. -
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to StringFormat[StreamDecoder[A]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isolate(numberOfBits: Long): StreamDecoder[A]
Alias for
decode.isolate(numberOfBits)(this). -
def
isolateBytes(numberOfBytes: Long): StreamDecoder[A]
Alias for
decode.isolateBytes(numberOfBytes)(this). -
def
many: StreamDecoder[A]
Run this
StreamDecoderzero or more times until the input is exhausted. -
def
many1: StreamDecoder[A]
Run this
StreamDecoderone or more times until the input is exhausted. -
final
def
map[B](f: (A) ⇒ B): StreamDecoder[B]
Transform the output of this
StreamDecoderusing the functionf. -
final
def
mapEither[B](f: (A) ⇒ Either[Err, B]): StreamDecoder[B]
Transform the output of this
StreamDecoder, converting left values to decoding failures. -
def
narrow[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ A): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
narrowc[B](f: (A) ⇒ Attempt[B])(g: (B) ⇒ A): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nonEmpty(errIfEmpty: Err): StreamDecoder[A]
Raises a decoding error if the given decoder emits no results, otherwise runs
sas normal. -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
or[A2 >: A](d: StreamDecoder[A2]): StreamDecoder[A2]
Alias for
scodec.stream.decode.or(this,d).Alias for
scodec.stream.decode.or(this,d). Runsthis, then runsdifthisemits no elements. Example:tryOnce(codecs.int32).or(once(codecs.uint32)). This function does no backtracking of its own; any desired backtracking should be handled bythis. -
def
peek: StreamDecoder[A]
Alias for
scodec.stream.decode.peek(this). -
val
self: StreamDecoder[A]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
sepBy[B](implicit B: Lazy[Decoder[B]]): StreamDecoder[A]
Alternate between decoding
Avalues using thisStreamDecoder, and decodingBvalues which are ignored. -
final
def
strict: Decoder[Vector[A]]
Create a strict (i.e., non-stream) decoder.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
take(n: Long): StreamDecoder[A]
Decode at most
nvalues using thisStreamDecoder. -
def
takeWhile(f: (A) ⇒ Boolean): StreamDecoder[A]
Decode values as long as the predicate tests true.
-
final
def
through[B](p: Pipe[Cursor, A, B]): StreamDecoder[B]
Transform the output of this
StreamDecoderusing the given pipe. -
final
def
through2[B, C](d: StreamDecoder[B])(t: Pipe2[Cursor, A, B, C]): StreamDecoder[C]
Combine the output of this
StreamDecoderwith another streaming decoder, using the given binary stream transducer.Combine the output of this
StreamDecoderwith another streaming decoder, using the given binary stream transducer. Note that bothdandthiswill operate on the same inputBitVector, so this combinator is more useful for expressing alternation between two decoders. -
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
widen[B](f: (A) ⇒ B, g: (B) ⇒ Attempt[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
widenOpt[B](f: (A) ⇒ B, g: (B) ⇒ Option[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
widenOptc[B](f: (A) ⇒ B)(g: (B) ⇒ Option[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
widenc[B](f: (A) ⇒ B)(g: (B) ⇒ Attempt[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
withFilter(f: (A) ⇒ Boolean): StreamDecoder[A]
Skip any decoded values for which the predicate tests false.
-
def
xmap[B](f: (A) ⇒ B, g: (B) ⇒ A): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
def
xmapc[B](f: (A) ⇒ B)(g: (B) ⇒ A): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
-
final
def
|[A2 >: A](d: StreamDecoder[A2]): StreamDecoder[A2]
Operator alias for
this.or(d). -
def
→[B](y: B): (StreamDecoder[A], B)
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to ArrowAssoc[StreamDecoder[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
Deprecated Value Members
-
def
pxmap[B](f: (A) ⇒ B, g: (B) ⇒ Option[A]): StreamDecoder[B]
- Implicit
- This member is added by an implicit conversion from StreamDecoder[A] to TransformSyntax[StreamDecoder, A] performed by method TransformSyntax in scodec. This conversion will take place only if an implicit value of type Transform[StreamDecoder] is in scope.
- Definition Classes
- TransformSyntax
- Annotations
- @deprecated
- Deprecated
(Since version 1.7.0) Use widenOpt instead