Top Description Fields Constructors Methods
org.hsqldb.rowio

public Class RowOutputBinary

extends RowOutputBase
Class Inheritance
Known Direct Subclasses
org.hsqldb.rowio.RowOutputBinaryEncode
Imports
java.math.BigDecimal, .BigInteger, org.hsqldb.Row, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.StringConverter, org.hsqldb.types.BinaryData, .BlobData, .ClobData, .IntervalMonthData, .IntervalSecondData, .JavaObjectData, .TimeData, .TimestampData, .Type, .Types

Provides methods for writing the data for a row to a byte array. The new format of data consists of mainly binary values and is not compatible with v.1.6.x databases.
Authors
Bob Preston (sqlbob@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.0
Version
2.5.0

Field Summary

Modifier and TypeField and Description
public static final int
pack-priv final int
pack-priv final int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public
public
RowOutputBinary(int initialSize, int scale)

public
RowOutputBinary(byte[]
byte[]
buffer
)

Constructor used for network transmission of result sets

Method Summary

Modifier and TypeMethod and Description
public RowOutputInterface
public void
ensureRoom(int
amount of extra space
extra
)

Overrides org.hsqldb.lib.HsqlByteArrayOutputStream.ensureRoom.

public int

Returns:

size of byte array
getSize
(Row
- a database row
row
)

Implements org.hsqldb.rowio.RowOutputInterface.getSize.

Calculate the size of byte array required to store a row.

public int
getSize(int[] array)

public int

Returns:

size of byte array
getSize
(Object[]
- the row data
data
,
int
- number of data[] elements to include in calculation
l
,
Type[]
- array of java.sql.Types values
types
)

Calculate the size of byte array required to store a row.

private int
getSize(Object o, Type type)

public int
public void
public void
public void
public long
public void
public void
protected void
public void
writeArray(int[] o)

protected void
protected void
protected void
protected void
protected void
public void
writeByteArray(byte[] b)

public void
writeByteArray16(byte[] b)

public void
protected void
public void
writeCharArray(char[] c)

protected void
public void
writeData(Row row, Type[] types)

Overrides org.hsqldb.rowio.RowOutputBase.writeData.

Implements org.hsqldb.rowio.RowOutputInterface.writeData.

This method is called to write data for a table row.

protected void
protected void
protected void
public void
public void
public void
writeIntData(int i, int position)

protected void
public void
protected void
protected void
public void
protected void
public void
protected void
protected void
public void
protected void
protected void
Inherited from org.hsqldb.rowio.RowOutputBase:
getOutputStreamwriteDatawriteDatawriteFieldPrefix

Field Detail

INT_STORE_SIZEback to summary
public static final int INT_STORE_SIZE
maskback to summary
pack-priv final int mask
scaleback to summary
pack-priv final int scale
sizePositionback to summary
pack-priv int sizePosition
storageSizeback to summary
pack-priv int storageSize

Constructor Detail

RowOutputBinaryback to summary
public RowOutputBinary()
RowOutputBinaryback to summary
public RowOutputBinary(int initialSize, int scale)
RowOutputBinaryback to summary
public RowOutputBinary(byte[] buffer)

Constructor used for network transmission of result sets

Parameters
buffer:byte[]

byte[]

Method Detail

duplicateback to summary
public RowOutputInterface duplicate()

Implements abstract org.hsqldb.rowio.RowOutputBase.duplicate.

Implements org.hsqldb.rowio.RowOutputInterface.duplicate.

ensureRoomback to summary
public void ensureRoom(int extra)

Overrides org.hsqldb.lib.HsqlByteArrayOutputStream.ensureRoom.

Parameters
extra:int

amount of extra space

getSizeback to summary
public int getSize(Row row)

Implements org.hsqldb.rowio.RowOutputInterface.getSize.

Calculate the size of byte array required to store a row.

Parameters
row:Row

- a database row

Returns:int

size of byte array

getSizeback to summary
public int getSize(int[] array)
getSizeback to summary
public int getSize(Object[] data, int l, Type[] types)

Calculate the size of byte array required to store a row.

Parameters
data:Object[]

- the row data

l:int

- number of data[] elements to include in calculation

types:Type[]

- array of java.sql.Types values

Returns:int

size of byte array

getSizeback to summary
private int getSize(Object o, Type type)
getStorageSizeback to summary
public int getStorageSize(int size)

Implements org.hsqldb.rowio.RowOutputInterface.getStorageSize.

resetback to summary
public void reset()

Overrides org.hsqldb.lib.HsqlByteArrayOutputStream.reset.

Implements org.hsqldb.rowio.RowOutputInterface.reset.

resetback to summary
public void reset(int newSize)

Overrides org.hsqldb.lib.HsqlByteArrayOutputStream.reset.

Implements org.hsqldb.rowio.RowOutputInterface.reset.

resetback to summary
public void reset(byte[] buffer)

Overrides org.hsqldb.lib.HsqlByteArrayOutputStream.reset.

Implements org.hsqldb.rowio.RowOutputInterface.reset.

scaleFilePositionback to summary
public long scaleFilePosition(long position)

Implements org.hsqldb.rowio.RowOutputInterface.scaleFilePosition.

setModeback to summary
public void setMode(int mode)

Implements org.hsqldb.rowio.RowOutputInterface.setMode.

setStorageSizeback to summary
public void setStorageSize(int size)

Implements org.hsqldb.rowio.RowOutputInterface.setStorageSize.

writeArrayback to summary
protected void writeArray(Object[] o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeArray.

writeArrayback to summary
public void writeArray(int[] o)
writeBigintback to summary
protected void writeBigint(Number o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeBigint.

writeBinaryback to summary
protected void writeBinary(BinaryData o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeBinary.

writeBitback to summary
protected void writeBit(BinaryData o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeBit.

writeBlobback to summary
protected void writeBlob(BlobData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeBlob.

writeBooleanback to summary
protected void writeBoolean(Boolean o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeBoolean.

writeByteArrayback to summary
public void writeByteArray(byte[] b)
writeByteArray16back to summary
public void writeByteArray16(byte[] b)
writeBytesback to summary
public void writeBytes(byte[] b)

Implements org.hsqldb.rowio.RowOutputInterface.writeBytes.

writeCharback to summary
protected void writeChar(String s, Type t)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeChar.

writeCharArrayback to summary
public void writeCharArray(char[] c)
writeClobback to summary
protected void writeClob(ClobData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeClob.

writeDataback to summary
public void writeData(Row row, Type[] types)

Overrides org.hsqldb.rowio.RowOutputBase.writeData.

Implements org.hsqldb.rowio.RowOutputInterface.writeData.

Doc from org.hsqldb.rowio.RowOutputBase.writeData.

This method is called to write data for a table row.

writeDateback to summary
protected void writeDate(TimestampData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeDate.

writeDaySecondIntervalback to summary
protected void writeDaySecondInterval(IntervalSecondData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeDaySecondInterval.

writeDecimalback to summary
protected void writeDecimal(BigDecimal o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeDecimal.

writeEndback to summary
public void writeEnd()

Implements org.hsqldb.rowio.RowOutputInterface.writeEnd.

writeFieldTypeback to summary
public void writeFieldType(Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeFieldType.

writeIntDataback to summary
public void writeIntData(int i, int position)
writeIntegerback to summary
protected void writeInteger(Number o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeInteger.

writeNullback to summary
public void writeNull(Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeNull.

writeOtherback to summary
protected void writeOther(JavaObjectData o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeOther.

writeRealback to summary
protected void writeReal(Double o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeReal.

writeSizeback to summary
public void writeSize(int size)

Implements org.hsqldb.rowio.RowOutputInterface.writeSize.

writeSmallintback to summary
protected void writeSmallint(Number o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeSmallint.

writeStringback to summary
public void writeString(String s)

Implements org.hsqldb.rowio.RowOutputInterface.writeString.

writeTimeback to summary
protected void writeTime(TimeData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeTime.

writeTimestampback to summary
protected void writeTimestamp(TimestampData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeTimestamp.

writeTypeback to summary
public void writeType(int type)

Implements org.hsqldb.rowio.RowOutputInterface.writeType.

writeUUIDback to summary
protected void writeUUID(BinaryData o)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeUUID.

writeYearMonthIntervalback to summary
protected void writeYearMonthInterval(IntervalMonthData o, Type type)

Implements abstract org.hsqldb.rowio.RowOutputBase.writeYearMonthInterval.