Decoder Trait
Description
A trait for defining a decoder class that converts a byte array into the specified type.
Summary
trait Decoder[T] extends Encoding
-
def fromBytes(bytes: Array[Byte])( implicit encoding: Option[Properties] => Charset) : T
Prototype
trait Decoder[T] extends Encoding
Type Parameters
T — the type into which to covert (decode) the data.
fromBytes Method
Converts a byte array into the specified data type.
Syntax
fromBytes(bytes: Array[Byte])(
implicit encoding: Option[Properties] => Charset)
: T
Parameters
- bytes
The byte array to convert (decode).
- Type:
Array[Bytes]
- Requirement: Required
- Type:
- encoding
An implicit encoding function that returns a string character encoding.
- Type:
encoding: Option[Properties] => Charset)
- Requirement: Implicit
- Type:
Return Value
Returns the converted (decoded) data in the specified data format (