StringDecoder Class
Description
A class for defining a Decoder object that converts a byte array into a string.
Summary
class StringDecoder(config: Option[Properties] = None)
extends Decoder[String]
-
def fromBytes(bytes: Array[Byte])( implicit encoding: Option[Properties] => Charset) : String
Instance Constructors
Syntax
new StringDecoder(config: Option[Properties])
Parameters and Data Members
- config
Optional properties that are passed to the
encoding function of the class'sfromBytes method.- Type:
Option[Properties]
- Requirement: Optional
- Type:
fromBytes Method
Converts a byte array into a string.
Syntax
fromBytes(bytes: Array[Byte])(
implicit encoding: Option[Properties] => Charset)
: String
Parameters
- bytes
The byte array to convert (decode).
- Type:
Array[Bytes]
- Requirement: Required
- Type:
- encoding
An implicit function that returns the character encoding to use in the conversion.
- Type:
encoding: Option[Properties] => Charset)
- Requirement: Implicit
- Type:
Return Value
Returns the converted (decoded) string.