Top Description Fields Constructors Methods
org.hsqldb.rowio

public Class RowInputText

extends RowInputBase
implements RowInputInterface
Class Inheritance
All Implemented Interfaces
org.hsqldb.rowio.RowInputInterface
Known Direct Subclasses
org.hsqldb.rowio.RowInputTextQuoted
Imports
java.math.BigDecimal, org.hsqldb.Scanner, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.map.ValuePool, org.hsqldb.persist.TextFileSettings, org.hsqldb.types.BinaryData, .BlobData, .BlobDataID, .ClobData, .ClobDataID, .IntervalMonthData, .IntervalSecondData, .IntervalType, .JavaObjectData, .TimeData, .TimestampData, .Type, .Types

Class for reading the data for a database row in text table format.
Author
Bob Preston (sqlbob@users dot sourceforge.net)
Since
1.7.0
Version
2.5.0

Field Summary

Modifier and TypeField and Description
protected int
private String
private boolean
private int
protected long
private String
private boolean
private int
private int
protected int
protected Scanner
protected String
protected TextFileSettings
private int
private String
private boolean
private int
Inherited from org.hsqldb.rowio.RowInputBase:
filePosNO_POSsize

Constructor Summary

AccessConstructor and Description
public
RowInputText(TextFileSettings textFileSettings)

fredt@users - comment - in future may use a custom subclasse of InputStream to read the data.

Method Summary

Modifier and TypeMethod and Description
protected String
getField(String sep, int sepLen, boolean isEnd)

public long
protected Object[]
protected Long
protected BinaryData
protected BinaryData
protected BlobData
protected Boolean
public byte
public char
protected String
readChar(Type type)

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

This does not check the length of the character string.

protected ClobData
protected TimestampData
protected IntervalSecondData
protected BigDecimal
public int
protected Integer
public long
private String
readLongVarString()

Obsoleted in 1.9.0

protected boolean
protected Object
protected Double
public short
protected Integer
public String
protected TimeData
protected TimestampData
public int
protected BinaryData
private String
protected IntervalMonthData
public void
reset()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.reset.

Repositions this stream to the position at the time the mark method was last called on this input stream.

public void
setSource(String text, long pos, int byteSize)

public void
Inherited from org.hsqldb.rowio.RowInputBase:
getBuffergetFilePositiongetSizereadDatareadDatareadLineresetBlockresetRowskipBytes

Field Detail

fieldback to summary
protected int field
fieldSepback to summary
private String fieldSep
fieldSepEndback to summary
private boolean fieldSepEnd
fieldSepLenback to summary
private int fieldSepLen
lineback to summary
protected long line
longvarSepback to summary
private String longvarSep
longvarSepEndback to summary
private boolean longvarSepEnd
longvarSepLenback to summary
private int longvarSepLen
maxPooledStringLengthback to summary
private int maxPooledStringLength
nextback to summary
protected int next
scannerback to summary
protected Scanner scanner
textback to summary
protected String text
textFileSettingsback to summary
protected TextFileSettings textFileSettings
textLenback to summary
private int textLen
varSepback to summary
private String varSep
varSepEndback to summary
private boolean varSepEnd
varSepLenback to summary
private int varSepLen

Constructor Detail

RowInputTextback to summary
public RowInputText(TextFileSettings textFileSettings)

fredt@users - comment - in future may use a custom subclasse of InputStream to read the data.

Method Detail

getFieldback to summary
protected String getField(String sep, int sepLen, boolean isEnd)
getLineNumberback to summary
public long getLineNumber()
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.

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.

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.

This does not check the length of the character string. The text file may contain strings that are longer than allowed by the declared type.

readClobback to summary
protected ClobData readClob()

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

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.

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

readLongVarStringback to summary
private String readLongVarString()

Obsoleted in 1.9.0

readNullback to summary
protected 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.

readVarStringback to summary
private String readVarString()
readYearMonthIntervalback to summary
protected IntervalMonthData readYearMonthInterval(Type type)

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

resetback to summary
public void reset()

Overrides org.hsqldb.lib.HsqlByteArrayInputStream.reset.

Doc from java.io.InputStream.reset.

Repositions this stream to the position at the time the mark method was last called on this input stream.

The general contract of reset is:

  • If the method markSupported returns true, then:
    • If the method mark has not been called since the stream was created, or the number of bytes read from the stream since mark was last called is larger than the argument to mark at that last call, then an IOException might be thrown.
    • If such an IOException is not thrown, then the stream is reset to a state such that all the bytes read since the most recent call to mark (or since the start of the file, if mark has not been called) will be resupplied to subsequent callers of the read method, followed by any bytes that otherwise would have been the next input data as of the time of the call to reset.
  • If the method markSupported returns false, then:
    • The call to reset may throw an IOException.
    • If an IOException is not thrown, then the stream is reset to a fixed state that depends on the particular type of the input stream and how it was created. The bytes that will be supplied to subsequent callers of the read method depend on the particular type of the input stream.
setSourceback to summary
public void setSource(String text, long pos, int byteSize)
skippedLineback to summary
public void skippedLine()