com.sleepycat.bdb.bind
Class ByteArrayBinding

java.lang.Object
  extended by com.sleepycat.bdb.bind.ByteArrayBinding
All Implemented Interfaces:
DataBinding

public class ByteArrayBinding
extends java.lang.Object
implements DataBinding

A transparent binding where the data byte array is used as the object. The Object of the binding is of type byte[] and the data is nothing more than the byte array itself.


Constructor Summary
ByteArrayBinding(ByteArrayFormat format)
          Creates a byte array binding.
 
Method Summary
 java.lang.Object dataToObject(DataBuffer data)
          Converts a data buffer into an Object.
 DataFormat getDataFormat()
          Returns the format used for the data of this binding.
 void objectToData(java.lang.Object object, DataBuffer data)
          Converts an Object into a data buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayBinding

public ByteArrayBinding(ByteArrayFormat format)
Creates a byte array binding.

Parameters:
format - is the format of the new binding.
Method Detail

dataToObject

public java.lang.Object dataToObject(DataBuffer data)
                              throws java.io.IOException
Description copied from interface: DataBinding
Converts a data buffer into an Object.

Specified by:
dataToObject in interface DataBinding
Parameters:
data - is the source data buffer.
Returns:
the resulting Object.
Throws:
java.io.IOException

objectToData

public void objectToData(java.lang.Object object,
                         DataBuffer data)
                  throws java.io.IOException
Description copied from interface: DataBinding
Converts an Object into a data buffer.

Specified by:
objectToData in interface DataBinding
Parameters:
object - is the source Object.
data - is the destination data buffer.
Throws:
java.io.IOException

getDataFormat

public DataFormat getDataFormat()
Description copied from interface: DataBinding
Returns the format used for the data of this binding.

Specified by:
getDataFormat in interface DataBinding
Returns:
the data format.