org.hsqldb.rowio
Class RowInputBase

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.hsqldb.lib.HsqlByteArrayInputStream
          extended byorg.hsqldb.rowio.RowInputBase
All Implemented Interfaces:
DataInput
Direct Known Subclasses:
RowInputBinary, RowInputLegacy, RowInputText

public abstract class RowInputBase
extends HsqlByteArrayInputStream

Base class for reading the data for a database row in different formats. Defines the methods that are independent of storage format and declares the format-dependent methods that subclasses should define.

Since:
1.7.0
Version:
1.7.2
Author:
sqlbob@users (RMP), fredt@users

Field Summary
protected  int filePos
           
protected  boolean makeSystemId
           
protected  int nextPos
           
protected  int size
           
 
Fields inherited from class org.hsqldb.lib.HsqlByteArrayInputStream
buf, count, mark, pos
 
Constructor Summary
RowInputBase()
           
RowInputBase(byte[] buf)
          Constructor takes a complete row
 
Method Summary
protected abstract  boolean checkNull()
           
 byte[] getBuffer()
           
 int getNextPos()
           
 int getPos()
           
 int getSize()
           
static RowInputInterface newRowInput(int cachedRowType)
           
protected abstract  Long readBigint()
           
protected abstract  Binary readBinary(int type)
           
protected abstract  Boolean readBit()
           
protected abstract  String readChar(int type)
           
 Object[] readData(int[] colTypes)
          reads row data from a stream using the JDBC types in colTypes
protected abstract  Date readDate()
           
protected abstract  BigDecimal readDecimal()
           
abstract  int readIntData()
           
protected abstract  Integer readInteger()
           
 String readLine()
           
protected abstract  Object readOther()
           
protected abstract  Double readReal(int type)
           
protected abstract  Integer readSmallint()
           
abstract  String readString()
           
protected abstract  Time readTime()
           
protected abstract  Timestamp readTimestamp()
           
abstract  int readType()
           
 void resetRow(int filepos, int rowsize)
          Used to reset the row, ready for a new row to be written into the byte[] buffer by an external routine.
 void setSystemId(boolean flag)
           
 int skipBytes(int n)
           
 
Methods inherited from class org.hsqldb.lib.HsqlByteArrayInputStream
available, close, mark, markSupported, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, reset, skip
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filePos

protected int filePos

nextPos

protected int nextPos

size

protected int size

makeSystemId

protected boolean makeSystemId
Constructor Detail

RowInputBase

public RowInputBase()

RowInputBase

public RowInputBase(byte[] buf)
Constructor takes a complete row

Method Detail

newRowInput

public static RowInputInterface newRowInput(int cachedRowType)
                                     throws HsqlException
Throws:
HsqlException

getPos

public int getPos()
           throws IOException
Throws:
IOException

getNextPos

public int getNextPos()
               throws IOException
Throws:
IOException

getSize

public int getSize()

readIntData

public abstract int readIntData()
                         throws IOException
Throws:
IOException

readType

public abstract int readType()
                      throws IOException
Throws:
IOException

readString

public abstract String readString()
                           throws IOException
Throws:
IOException

checkNull

protected abstract boolean checkNull()
                              throws IOException
Throws:
IOException

readChar

protected abstract String readChar(int type)
                            throws IOException,
                                   HsqlException
Throws:
IOException
HsqlException

readSmallint

protected abstract Integer readSmallint()
                                 throws IOException,
                                        HsqlException
Throws:
IOException
HsqlException

readInteger

protected abstract Integer readInteger()
                                throws IOException,
                                       HsqlException
Throws:
IOException
HsqlException

readBigint

protected abstract Long readBigint()
                            throws IOException,
                                   HsqlException
Throws:
IOException
HsqlException

readReal

protected abstract Double readReal(int type)
                            throws IOException,
                                   HsqlException
Throws:
IOException
HsqlException

readDecimal

protected abstract BigDecimal readDecimal()
                                   throws IOException,
                                          HsqlException
Throws:
IOException
HsqlException

readBit

protected abstract Boolean readBit()
                            throws IOException,
                                   HsqlException
Throws:
IOException
HsqlException

readTime

protected abstract Time readTime()
                          throws IOException,
                                 HsqlException
Throws:
IOException
HsqlException

readDate

protected abstract Date readDate()
                          throws IOException,
                                 HsqlException
Throws:
IOException
HsqlException

readTimestamp

protected abstract Timestamp readTimestamp()
                                    throws IOException,
                                           HsqlException
Throws:
IOException
HsqlException

readOther

protected abstract Object readOther()
                             throws IOException,
                                    HsqlException
Throws:
IOException
HsqlException

readBinary

protected abstract Binary readBinary(int type)
                              throws IOException,
                                     HsqlException
Throws:
IOException
HsqlException

setSystemId

public void setSystemId(boolean flag)

readData

public Object[] readData(int[] colTypes)
                  throws IOException,
                         HsqlException
reads row data from a stream using the JDBC types in colTypes

Parameters:
colTypes - currently only the length is used
Returns:
Throws:
IOException
HsqlException

resetRow

public void resetRow(int filepos,
                     int rowsize)
              throws IOException
Used to reset the row, ready for a new row to be written into the byte[] buffer by an external routine.

Throws:
IOException

getBuffer

public byte[] getBuffer()

skipBytes

public int skipBytes(int n)
              throws IOException
Specified by:
skipBytes in interface DataInput
Overrides:
skipBytes in class HsqlByteArrayInputStream
Throws:
IOException

readLine

public String readLine()
                throws IOException
Specified by:
readLine in interface DataInput
Overrides:
readLine in class HsqlByteArrayInputStream
Throws:
IOException


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.