Decoder Trait

On This Page
Fully Qualified Name

io.iguaz.v3io.spark.streaming.Decoder

Description

A trait for defining a decoder class that converts a byte array into the specified type.

Summary

Prototype

trait Decoder[T] extends Encoding
Methods
  • fromBytes

    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
encoding
An implicit encoding function that returns a string character encoding.

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

Return Value

Returns the converted (decoded) data in the specified data format (T).