public final class

ByteArrayConverter

extends Object
java.lang.Object
   ↳ org.mule.module.hbase.api.ByteArrayConverter

Class Overview

Object to byte array converter.

Summary

Fields
private final Charset conversionCharset The Charset used for converting strings to byte array
Public Constructors
ByteArrayConverter(Charset convertionCharset)
Public Methods
byte[] toByteArray(Object o)
Converts the given object into a byte array.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private final Charset conversionCharset

The Charset used for converting strings to byte array

Public Constructors

public ByteArrayConverter (Charset convertionCharset)

Parameters
convertionCharset

Public Methods

public byte[] toByteArray (Object o)

Converts the given object into a byte array. If the object is a byte array, is is returned as is. If the object is an string, it is written in the provided conversionCharset given by constructor. Any other serializable object is converted into a byte array using serialization.

Parameters
o
Returns
  • a byte array representation of the given object