org.postgresql.util
Interface PGBinaryObject

All Known Implementing Classes:
PGbox, PGpoint

public interface PGBinaryObject

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


Method Summary
 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.
 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 org.postgresql.
 

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 org.postgresql.

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 org.postgresql.

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


Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.