com.amazon.redshift.util

## Interface RedshiftBinaryObject

All Known Implementing Classes:
  RedshiftBox, RedshiftPoint

    public interface RedshiftBinaryObject

RedshiftBinaryObject is an interface that classes extending `RedshiftObject` can use to take advantage of more optimal binary encoding of the data type.

### Method Summary

All Methods Instance Methods Abstract Methods
`int` `lengthInBytes()` This method is called to return the number of bytes needed to store this object in the binary form required by com.amazon.redshift.
`void` `setByteValue(byte[] value, int offset)` This method is called to set the value of this object.
`void` `toBytes(byte[] bytes, int offset)` This method is called the to store the value of the object, in the binary form required by com.amazon.redshift.

### Method Detail

#### setByteValue

    void setByteValue(byte[] value,
                      int offset)
               throws SQLException

This method is called to set the value of this object.

Parameters:
  `value` - data containing the binary representation of the value of the object
  `offset` - the offset in the byte array where object data starts
Throws:
  `SQLException` - thrown if value is invalid for this type

#### lengthInBytes

    int lengthInBytes()

This method is called to return the number of bytes needed to store this object in the binary form required by com.amazon.redshift.

Returns:
  the number of bytes needed to store this object

#### toBytes

    void toBytes(byte[] bytes,
                 int offset)

This method is called the to store the value of the object, in the binary form required by com.amazon.redshift.

Parameters:
  `bytes` - the array to store the value, it is guaranteed to be at lest `lengthInBytes()` in size.
  `offset` - the offset in the byte array where object must be stored