Trait/Object

scodec.stream.decode

StreamDecoder

Related Docs: object StreamDecoder | package decode

Permalink

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
Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
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

Abstract Value Members

  1. abstract def decoder: Process[Cursor, A]

    Permalink

    The Process backing this StreamDecoder.

    The Process backing this StreamDecoder. All functions on StreamDecoder are defined in terms of this Process.

Concrete 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. final def ++[A2 >: A](d: ⇒ StreamDecoder[A2]): StreamDecoder[A2]

    Permalink

    Run this StreamDecoder, then d, then concatenate the two streams.

  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 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
  8. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def collect[B](pf: PartialFunction[A, B]): StreamDecoder[B]

    Permalink

    Transform the output of this StreamDecoder using the partial function pf.

  11. final def decode(bits: ⇒ BitVector): Process[Task, A]

    Permalink

    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.

  12. def decodeAllValid(bits: ⇒ BitVector): Vector[A]

    Permalink

    Decode the given BitVector, returning a strict Vector of the results, and throwing an exception in the event of a decoding error.

  13. final def decodeAsyncResource[R](acquire: Task[R])(read: (R) ⇒ BitVector, release: (R) ⇒ Task[Unit]): Process[Task, A]

    Permalink

    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.

  14. final def decodeChannel(in: ⇒ ReadableByteChannel, chunkSizeInBytes: Int = 1024 * 1000 * 16, direct: Boolean = false): Process[Task, A]

    Permalink

    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.

  15. final def decodeInputStream(in: ⇒ InputStream, chunkSizeInBytes: Int = 1024 * 1000 * 16): Process[Task, A]

    Permalink

    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.

  16. final def decodeMmap(in: ⇒ FileChannel, chunkSizeInBytes: Int = 1024 * 1000 * 16): Process[Task, A]

    Permalink

    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.

  17. final def decodeResource[R](acquire: ⇒ R)(read: (R) ⇒ BitVector, release: (R) ⇒ Unit): Process[Task, A]

    Permalink

    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.

  18. def drop(n: Int): StreamDecoder[A]

    Permalink

    Ignore the first n decoded values.

  19. def dropWhile(f: (A) ⇒ Boolean): StreamDecoder[A]

    Permalink

    Ignore decoded values as long as the predicate tests true.

  20. final def edit[B](f: (Process[Cursor, A]) ⇒ Process[Cursor, B]): StreamDecoder[B]

    Permalink

    Modify the Process[Cursor,A] backing this StreamDecoder.

  21. 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
  22. 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
  23. 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
  24. 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
  25. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. 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
  28. 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
  29. def filter(f: (A) ⇒ Boolean): StreamDecoder[A]

    Permalink

    Skip any decoded values for which the predicate tests false.

  30. def finalize(): Unit

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

    Permalink

    Equivalent to dropWhile(f).take(1) - returns a stream of (at most) one element, consisting of the first output for which f tests false.

  32. final def flatMap[B](f: (A) ⇒ StreamDecoder[B]): StreamDecoder[B]

    Permalink

    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.

  33. final def flatMapP[B](f: (A) ⇒ Process[Cursor, B]): StreamDecoder[B]

    Permalink

    Like flatMap, but takes a function that produces a Process[Cursor,B].

  34. 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()
  35. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  38. def isolate(numberOfBits: Long): StreamDecoder[A]

    Permalink

    Alias for decode.isolate(numberOfBits)(this).

  39. def isolateBytes(numberOfBytes: Long): StreamDecoder[A]

    Permalink

    Alias for decode.isolateBytes(numberOfBytes)(this).

  40. def many: StreamDecoder[A]

    Permalink

    Run this StreamDecoder zero or more times until the input is exhausted.

  41. def many1: StreamDecoder[A]

    Permalink

    Run this StreamDecoder one or more times until the input is exhausted.

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

    Permalink

    Transform the output of this StreamDecoder using the function f.

  43. final def mapEither[B](f: (A) ⇒ \/[Err, B]): StreamDecoder[B]

    Permalink

    Transform the output of this StreamDecoder, converting left values to decoding failures.

  44. 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
  45. 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
  46. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  47. def nonEmpty(errIfEmpty: Err): StreamDecoder[A]

    Permalink

    Raises a decoding error if the given decoder emits no results, otherwise runs p as normal.

  48. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  50. final def onComplete[A2 >: A](d: ⇒ StreamDecoder[A2]): StreamDecoder[A2]

    Permalink

    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.

  51. final def or[A2 >: A](d: StreamDecoder[A2]): StreamDecoder[A2]

    Permalink

    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.

  52. def peek: StreamDecoder[A]

    Permalink

    Alias for scodec.stream.decode.peek(this).

  53. final def pipe[B](p: Process1[A, B]): StreamDecoder[B]

    Permalink

    Transform the output of this StreamDecoder using the given single-input stream transducer.

  54. 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
  55. def sepBy[B](implicit B: Lazy[Decoder[B]]): StreamDecoder[A]

    Permalink

    Alternate between decoding A values using this StreamDecoder, and decoding B values which are ignored.

  56. final def strict: Decoder[Vector[A]]

    Permalink

    Create a strict (i.e., non-stream) decoder.

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

    Permalink
    Definition Classes
    AnyRef
  58. def take(n: Int): StreamDecoder[A]

    Permalink

    Decode at most n values using this StreamDecoder.

  59. def takeWhile(f: (A) ⇒ Boolean): StreamDecoder[A]

    Permalink

    Decode values as long as the predicate tests true.

  60. final def tee[B, C](d: StreamDecoder[B])(t: Tee[A, B, C]): StreamDecoder[C]

    Permalink

    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.

  61. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. 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
  66. 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
  67. 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
  68. 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
  69. def withFilter(f: (A) ⇒ Boolean): StreamDecoder[A]

    Permalink

    Skip any decoded values for which the predicate tests false.

  70. 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
  71. 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
  72. final def |[A2 >: A](d: StreamDecoder[A2]): StreamDecoder[A2]

    Permalink

    Operator alias for this.or(d).

  73. final def |>[B](p: Process1[A, B]): StreamDecoder[B]

    Permalink

    Alias for this pipe p.

  74. 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