Top Description Fields Constructors Methods
org.hsqldb.rowio

public Class RowInputBinary

extends RowInputBase
implements RowInputInterface
Class Inheritance
All Implemented Interfaces
org.hsqldb.rowio.RowInputInterface
Known Direct Subclasses
org.hsqldb.rowio.RowInputBinaryDecode
Imports
java.io.EOFException, .IOException, java.math.BigDecimal, .BigInteger, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.StringConverter, org.hsqldb.map.ValuePool, org.hsqldb.types.BinaryData, .BlobData, .BlobDataID, .ClobData, .ClobDataID, .IntervalMonthData, .IntervalSecondData, .IntervalType, .JavaObjectData, .TimeData, .TimestampData, .Type, .Types

Provides methods for reading the data for a row from a byte array. The format of data is that used for storage of cached tables by v.1.6.x databases, apart from strings.
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 boolean
private RowOutputBinary
Inherited from org.hsqldb.rowio.RowInputBase:
filePosNO_POSsize

Constructor Summary

AccessConstructor and Description
public
public
RowInputBinary(int size)

public
RowInputBinary(byte[] buf)

public
RowInputBinary(RowOutputBinary out)

uses the byte[] buffer from out.

Method Summary

Modifier and TypeMethod and Description
protected Object[]
protected Long
protected BinaryData
protected BinaryData
protected BlobData
protected Boolean
public boolean
readBoolean()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readBoolean.

Implements java.io.DataInput.readBoolean.

Reads one input byte and returns true if that byte is nonzero, false if that byte is zero.

public byte
public byte[]
public byte[]
public char
protected String
public char[]
protected ClobData
public Object[]
readData(Type[] colTypes)

Overrides org.hsqldb.rowio.RowInputBase.readData.

Implements org.hsqldb.rowio.RowInputInterface.readData.

reads row data from a stream using the JDBC types in colTypes

protected TimestampData
protected IntervalSecondData
protected BigDecimal
public void
readFully(byte[] b)

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readFully.

Implements java.io.DataInput.readFully.

Reads some bytes from an input stream and stores them into the buffer array b.

public int
public int[]
readIntArray()

Nulls in array are treated as 0

protected Integer
public long
public boolean
protected Object
protected Double
public short
protected Integer
public String
protected TimeData
protected TimestampData
public int
protected BinaryData
protected IntervalMonthData
public void
resetRow(int rowsize)

Used to reset the row, ready for Result data to be written into the byte[] buffer by an external routine.

public void
resetRow(long filepos, int rowsize)

Overrides org.hsqldb.rowio.RowInputBase.resetRow.

Implements org.hsqldb.rowio.RowInputInterface.resetRow.

Used to reset the row, ready for a new db row to be written into the byte[] buffer by an external routine.

Inherited from org.hsqldb.rowio.RowInputBase:
getBuffergetFilePositiongetSizereadDatareadLineresetBlockskipBytes

Field Detail

ignoreDataErrorsback to summary
public boolean ignoreDataErrors
outback to summary
private RowOutputBinary out

Constructor Detail

RowInputBinaryback to summary
public RowInputBinary()
RowInputBinaryback to summary
public RowInputBinary(int size)
RowInputBinaryback to summary
public RowInputBinary(byte[] buf)
RowInputBinaryback to summary
public RowInputBinary(RowOutputBinary out)

uses the byte[] buffer from out. At each reset, the buffer is set to the current one for out.

Method Detail

readArrayback to summary
protected Object[] readArray(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readArray.

readBigintback to summary
protected Long readBigint()

Implements abstract org.hsqldb.rowio.RowInputBase.readBigint.

readBinaryback to summary
protected BinaryData readBinary()

Implements abstract org.hsqldb.rowio.RowInputBase.readBinary.

readBitback to summary
protected BinaryData readBit()

Implements abstract org.hsqldb.rowio.RowInputBase.readBit.

readBlobback to summary
protected BlobData readBlob()

Implements abstract org.hsqldb.rowio.RowInputBase.readBlob.

readBooleback to summary
protected Boolean readBoole()

Implements abstract org.hsqldb.rowio.RowInputBase.readBoole.

readBooleanback to summary
public boolean readBoolean()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readBoolean.

Implements java.io.DataInput.readBoolean.

Doc from java.io.DataInput.readBoolean.

Reads one input byte and returns true if that byte is nonzero, false if that byte is zero. This method is suitable for reading the byte written by the writeBoolean method of interface DataOutput.

readByteback to summary
public byte readByte()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readByte.

Implements org.hsqldb.rowio.RowInputInterface.readByte, java.io.DataInput.readByte.

Doc from java.io.DataInput.readByte.

Reads and returns one input byte. The byte is treated as a signed value in the range -128 through 127, inclusive. This method is suitable for reading the byte written by the writeByte method of interface DataOutput.

readByteArrayback to summary
public byte[] readByteArray()
readByteArray16back to summary
public byte[] readByteArray16()
readCharback to summary
public char readChar()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readChar.

Implements org.hsqldb.rowio.RowInputInterface.readChar, java.io.DataInput.readChar.

Doc from java.io.DataInput.readChar.

Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is:

(char)((a << 8) | (b & 0xff))
This method is suitable for reading bytes written by the writeChar method of interface DataOutput.
readCharback to summary
protected String readChar(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readChar.

readCharArrayback to summary
public char[] readCharArray() throws IOException
readClobback to summary
protected ClobData readClob()

Implements abstract org.hsqldb.rowio.RowInputBase.readClob.

readDataback to summary
public Object[] readData(Type[] colTypes)

Overrides org.hsqldb.rowio.RowInputBase.readData.

Implements org.hsqldb.rowio.RowInputInterface.readData.

Doc from org.hsqldb.rowio.RowInputBase.readData.

reads row data from a stream using the JDBC types in colTypes

readDateback to summary
protected TimestampData readDate(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readDate.

readDaySecondIntervalback to summary
protected IntervalSecondData readDaySecondInterval(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readDaySecondInterval.

readDecimalback to summary
protected BigDecimal readDecimal(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readDecimal.

readFullyback to summary
public void readFully(byte[] b)

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readFully.

Implements java.io.DataInput.readFully.

Doc from java.io.DataInput.readFully.

Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b.

This method blocks until one of the following conditions occurs:

  • b.length bytes of input data are available, in which case a normal return is made.
  • End of file is detected, in which case an EOFException is thrown.
  • An I/O error occurs, in which case an IOException other than EOFException is thrown.

If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first byte read is stored into element b[0], the next one into b[1], and so on. If an exception is thrown from this method, then it may be that some but not all bytes of b have been updated with data from the input stream.

readIntback to summary
public int readInt()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readInt.

Implements org.hsqldb.rowio.RowInputInterface.readInt, java.io.DataInput.readInt.

Doc from java.io.DataInput.readInt.

Reads four input bytes and returns an int value. Let a-d be the first through fourth bytes read. The value returned is:

(((a & 0xff) << 24) | ((b & 0xff) << 16) |
 ((c & 0xff) <<  8) | (d & 0xff))
This method is suitable for reading bytes written by the writeInt method of interface DataOutput.
readIntArrayback to summary
public int[] readIntArray()

Nulls in array are treated as 0

readIntegerback to summary
protected Integer readInteger()

Implements abstract org.hsqldb.rowio.RowInputBase.readInteger.

readLongback to summary
public long readLong()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readLong.

Implements org.hsqldb.rowio.RowInputInterface.readLong, java.io.DataInput.readLong.

Doc from java.io.DataInput.readLong.

Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is:

(((long)(a & 0xff) << 56) |
 ((long)(b & 0xff) << 48) |
 ((long)(c & 0xff) << 40) |
 ((long)(d & 0xff) << 32) |
 ((long)(e & 0xff) << 24) |
 ((long)(f & 0xff) << 16) |
 ((long)(g & 0xff) <<  8) |
 ((long)(h & 0xff)))

This method is suitable for reading bytes written by the writeLong method of interface DataOutput.

readNullback to summary
public boolean readNull()

Implements abstract org.hsqldb.rowio.RowInputBase.readNull.

readOtherback to summary
protected Object readOther()

Implements abstract org.hsqldb.rowio.RowInputBase.readOther.

readRealback to summary
protected Double readReal()

Implements abstract org.hsqldb.rowio.RowInputBase.readReal.

readShortback to summary
public short readShort()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.readShort.

Implements org.hsqldb.rowio.RowInputInterface.readShort, java.io.DataInput.readShort.

Doc from java.io.DataInput.readShort.

Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is:

(short)((a << 8) | (b & 0xff))
This method is suitable for reading the bytes written by the writeShort method of interface DataOutput.
readSmallintback to summary
protected Integer readSmallint()

Implements abstract org.hsqldb.rowio.RowInputBase.readSmallint.

readStringback to summary
public String readString()

Implements abstract org.hsqldb.rowio.RowInputBase.readString.

Implements org.hsqldb.rowio.RowInputInterface.readString.

readTimeback to summary
protected TimeData readTime(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readTime.

readTimestampback to summary
protected TimestampData readTimestamp(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readTimestamp.

readTypeback to summary
public int readType()

Implements abstract org.hsqldb.rowio.RowInputBase.readType.

Implements org.hsqldb.rowio.RowInputInterface.readType.

readUUIDback to summary
protected BinaryData readUUID()

Implements abstract org.hsqldb.rowio.RowInputBase.readUUID.

readYearMonthIntervalback to summary
protected IntervalMonthData readYearMonthInterval(Type type)

Implements abstract org.hsqldb.rowio.RowInputBase.readYearMonthInterval.

resetRowback to summary
public void resetRow(int rowsize)

Used to reset the row, ready for Result data to be written into the byte[] buffer by an external routine.

resetRowback to summary
public void resetRow(long filepos, int rowsize)

Overrides org.hsqldb.rowio.RowInputBase.resetRow.

Implements org.hsqldb.rowio.RowInputInterface.resetRow.

Used to reset the row, ready for a new db row to be written into the byte[] buffer by an external routine.