Top Description Methods
org.postgresql.util

public Interface PGBinaryObject

Known Direct Implementers
org.postgresql.geometric.PGbox, org.postgresql.geometric.PGpoint
Imports
java.sql.SQLException

PGBinaryObject is a interface that classes extending PGobject can use to take advantage of more optimal binary encoding of the data type.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of bytes needed to store this object
lengthInBytes
()

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

public void
setByteValue(byte[]
data containing the binary representation of the value of the object
value
,
int
the offset in the byte array where object data starts
offset
)

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

public void
toBytes(byte[]
the array to store the value, it is guaranteed to be at lest lengthInBytes in size.
bytes
,
int
the offset in the byte array where object must be stored
offset
)

This method is called the to store the value of the object, in the binary form required by org.postgresql.

Method Detail

lengthInBytesback to summary
public int lengthInBytes()

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

Returns:int

the number of bytes needed to store this object

setByteValueback to summary
public void setByteValue(byte[] value, int offset) throws SQLException

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

Parameters
value:byte[]

data containing the binary representation of the value of the object

offset:int

the offset in the byte array where object data starts

Exceptions
SQLException:
thrown if value is invalid for this type
toBytesback to summary
public void toBytes(byte[] bytes, int offset)

This method is called the to store the value of the object, in the binary form required by org.postgresql.

Parameters
bytes:byte[]

the array to store the value, it is guaranteed to be at lest lengthInBytes in size.

offset:int

the offset in the byte array where object must be stored