Decoder
Supports decoding a value of type
A
from a BitVector
.- Companion
- object
class Object
trait Matchable
class Any
Document{}
Attempts to decode a value of type
A
from the specified bit vector.- Value Params
- bits
-
bits to decode
- Returns
-
error if value could not be decoded or the remaining bits and the decoded value
Attempts to decode a value of type
A
from the specified bit vector and discards the remaining bits.- Value Params
- bits
-
bits to decode
- Returns
-
error if value could not be decoded or the decoded value
final def decodeAll[B](f: A => B)(zero: B, append: (B, B) => B)(buffer: BitVector): (Option[Err], B)
Repeatedly decodes values of type
A
from the specified vector, converts each value to a B
and appends it to an accumulator of typeB
using the supplied zero
value and append
function. Terminates when no more bits are available in the vector. Exits upon first decoding error.- Returns
-
tuple consisting of the terminating error if any and the accumulated value
def collect[F <: ([_$3] =>> Any), A2 >: A](buffer: BitVector, limit: Option[Int])(factory: Factory[A2, F[A2]]): Attempt[DecodeResult[F[A2]]]
Repeatedly decodes values of type
Terminates when no more bits are available in the vector or when
decoded. Exits upon first decoding error.
A
from the specified vector and returns a collection of the specified type.Terminates when no more bits are available in the vector or when
limit
is defined and that many records have beendecoded. Exits upon first decoding error.