Class/Object

scodec.stream

StreamDecoder

Related Docs: object StreamDecoder | package stream

Permalink

final class StreamDecoder[+A] extends AnyRef

Supports binary decoding of a stream that emits elements as they are decoded.

The main purpose of using a StreamDecoder over an scodec.Decoder is mixing decoding with processing. For example, scodec.codecs.vector(decoderA): Decoder[Vector[A]] could be used to decode a bit stream but the decoded Vector[A] would not be emitted until the end of the bit stream. With StreamDecoder.many(decoderA): StreamDecoder[A], each decoded A value is emitted as soon as it is decoded.

The StreamDecoder companion has various constructors -- most importantly, once and many, that allow a Decoder[A] to be lifted to a StreamDecoder[A].

Given a StreamDecoder[A], a bit stream can be decoded via the decode method or by calling a variant of toPipe.

Self Type
StreamDecoder[A]
Source
StreamDecoder.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StreamDecoder
  2. AnyRef
  3. Any
Implicitly
  1. by TransformSyntax
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StreamDecoder(step: Step[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    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
  4. def ++[A2 >: A](that: ⇒ StreamDecoder[A2]): StreamDecoder[A2]

    Permalink

    Creates a stream decoder that first decodes until this decoder finishes and then decodes using the supplied decoder.

    Creates a stream decoder that first decodes until this decoder finishes and then decodes using the supplied decoder.

    Note: this should not be used to write recursive decoders (e.g., def ints: StreamDecoder[A] = once(int32) ++ ints) if each incremental decoding step can fail with InsufficientBits. Otherwise, it decoding can get stuck in an infinite loop, where the remaining bits are fed to the recursive call.

  5. def ->[B](y: B): (StreamDecoder[A], B)

    Permalink
    Implicit information
    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()
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def apply[F[_]](s: Stream[F, BitVector])(implicit arg0: RaiseThrowable[F]): Pull[F, A, Option[Stream[F, BitVector]]]

    Permalink

    Returns a Pull[F, A, Option[Stream[F, BitVector]]] given a Stream[F, BitVector].

    Returns a Pull[F, A, Option[Stream[F, BitVector]]] given a Stream[F, BitVector]. The result of the returned pull is the remainder of the input stream that was not used in decoding.

  8. def as[B](implicit as: Transformer[A, B]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def decode[F[_]](s: Stream[F, BitVector])(implicit arg0: RaiseThrowable[F]): Stream[F, A]

    Permalink

    Returns a Stream[F, A] given a Stream[F, BitVector].

  12. def ensuring(cond: (StreamDecoder[A]) ⇒ Boolean, msg: ⇒ Any): StreamDecoder[A]

    Permalink
    Implicit information
    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
  13. def ensuring(cond: (StreamDecoder[A]) ⇒ Boolean): StreamDecoder[A]

    Permalink
    Implicit information
    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
  14. def ensuring(cond: Boolean, msg: ⇒ Any): StreamDecoder[A]

    Permalink
    Implicit information
    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
  15. def ensuring(cond: Boolean): StreamDecoder[A]

    Permalink
    Implicit information
    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
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def exmap[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ Attempt[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  19. def exmapc[B](f: (A) ⇒ Attempt[B])(g: (B) ⇒ Attempt[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def flatMap[B](f: (A) ⇒ StreamDecoder[B]): StreamDecoder[B]

    Permalink

    Creates a stream decoder that, upon decoding an A, applies it to the supplied function and decodes the next part of the input with the returned decoder.

    Creates a stream decoder that, upon decoding an A, applies it to the supplied function and decodes the next part of the input with the returned decoder. When that decoder finishes, the remainder of the input is returned to the original decoder for further decoding.

  22. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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()
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. def isolate(bits: Long): StreamDecoder[A]

    Permalink

    Alias for StreamDecoder.isolate(bits)(this).

  27. def map[B](f: (A) ⇒ B): StreamDecoder[B]

    Permalink

    Maps the supplied function over each output of this decoder.

  28. def narrow[B](f: (A) ⇒ Attempt[B], g: (B) ⇒ A): StreamDecoder[B]

    Permalink
    Implicit information
    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
  29. def narrowc[B](f: (A) ⇒ Attempt[B])(g: (B) ⇒ A): StreamDecoder[B]

    Permalink
    Implicit information
    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
  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. val self: StreamDecoder[A]

    Permalink
    Implicit information
    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
  34. def strict: Decoder[Vector[A]]

    Permalink

    Converts this stream decoder to a Decoder[Vector[A]].

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toPipe[F[_]](implicit arg0: RaiseThrowable[F]): Pipe[F, BitVector, A]

    Permalink

    Converts this decoder to a Pipe[F, BitVector, A].

  37. def toPipeByte[F[_]](implicit arg0: RaiseThrowable[F]): Pipe[F, Byte, A]

    Permalink

    Converts this decoder to a Pipe[F, Byte, A].

  38. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def widen[B](f: (A) ⇒ B, g: (B) ⇒ Attempt[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  43. def widenOpt[B](f: (A) ⇒ B, g: (B) ⇒ Option[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  44. def widenOptc[B](f: (A) ⇒ B)(g: (B) ⇒ Option[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  45. def widenc[B](f: (A) ⇒ B)(g: (B) ⇒ Attempt[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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
  46. def xmap[B](f: (A) ⇒ B, g: (B) ⇒ A): StreamDecoder[B]

    Permalink
    Implicit information
    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
  47. def xmapc[B](f: (A) ⇒ B)(g: (B) ⇒ A): StreamDecoder[B]

    Permalink
    Implicit information
    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
  48. def [B](y: B): (StreamDecoder[A], B)

    Permalink
    Implicit information
    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

  1. def pxmap[B](f: (A) ⇒ B, g: (B) ⇒ Option[A]): StreamDecoder[B]

    Permalink
    Implicit information
    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

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion TransformSyntax from StreamDecoder[A] to TransformSyntax[StreamDecoder, A]

Inherited by implicit conversion any2stringadd from StreamDecoder[A] to any2stringadd[StreamDecoder[A]]

Inherited by implicit conversion StringFormat from StreamDecoder[A] to StringFormat[StreamDecoder[A]]

Inherited by implicit conversion Ensuring from StreamDecoder[A] to Ensuring[StreamDecoder[A]]

Inherited by implicit conversion ArrowAssoc from StreamDecoder[A] to ArrowAssoc[StreamDecoder[A]]

Ungrouped