StringDecoder Class

On This Page
Fully Qualified Name

io.iguaz.v3io.spark.streaming.Decoder.StringDecoder

Description

A class for defining a Decoder object that converts a byte array into a string.

Summary

Instance Constructors

class StringDecoder(config: Option[Properties] = None)
    extends Decoder[String]
Methods
  • fromBytes

    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's fromBytes method.

  • Type: Option[Properties]
  • Requirement: Optional

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
encoding

An implicit function that returns the character encoding to use in the conversion.

  • Type: encoding: Option[Properties] => Charset)
  • Requirement: Implicit

Return Value

Returns the converted (decoded) string.