scodec.stream.decode

StreamDecoder

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.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StreamDecoder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

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

    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

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

    Definition Classes
    AnyRef → Any
  3. final def ++[A2 >: A](d: ⇒ StreamDecoder[A2]): StreamDecoder[A2]

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

  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

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

    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.

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

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

  10. final def decodeAsyncResource[R](acquire: Task[R])(read: (R) ⇒ BitVector, release: (R) ⇒ Task[Unit]): Process[Task, 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 returned Process[Task,A] is finished being consumed. The acquire and release actions may be asynchronous.

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

    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.

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

    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.

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

    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.

  14. final def decodeResource[R](acquire: ⇒ R)(read: (R) ⇒ BitVector, release: (R) ⇒ Unit): Process[Task, 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 returned Process[Task,A] is finished being consumed. If the acquire and release actions are asynchronous, use decodeAsyncResource.

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

    Ignore the first n decoded values.

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

    Ignore decoded values as long as the predicate tests true.

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

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

  18. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  20. def filter(f: (A) ⇒ Boolean): StreamDecoder[A]

    Skip any decoded values for which the predicate tests false.

  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. 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 which f tests false.

  23. 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 each A produced by this StreamDecoder, then concatenates all the resulting streams of results. This is the same 'idea' as List.flatMap.

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

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

  25. final def getClass(): Class[_]

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

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

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

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

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

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

  30. def many: StreamDecoder[A]

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

  31. def many1: StreamDecoder[A]

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

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

    Transform the output of this StreamDecoder using the function f.

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

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

  34. final def ne(arg0: AnyRef): Boolean

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

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

  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

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

    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.

  39. 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). 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.

  40. def peek: StreamDecoder[A]

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

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

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

  42. def sepBy[B](implicit arg0: Decoder[B]): StreamDecoder[A]

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

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

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

    Decode at most n values using this StreamDecoder.

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

    Decode values as long as the predicate tests true.

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

    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.

  47. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. def withFilter(f: (A) ⇒ Boolean): StreamDecoder[A]

    Skip any decoded values for which the predicate tests false.

  52. final def |[A2 >: A](d: StreamDecoder[A2]): StreamDecoder[A2]

    Operator alias for this.or(d).

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

    Alias for this pipe p.

Inherited from AnyRef

Inherited from Any

Ungrouped