org.hsqldb.rowio
Class RowOutputBase

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.hsqldb.lib.HsqlByteArrayOutputStream
          extended byorg.hsqldb.rowio.RowOutputBase
All Implemented Interfaces:
DataOutput, RowOutputInterface
Direct Known Subclasses:
RowOutputBinary, RowOutputLegacy, RowOutputText, RowOutputTextLog

public abstract class RowOutputBase
extends HsqlByteArrayOutputStream
implements RowOutputInterface

Base class for writing 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
static int CACHED_ROW_160
           
static int CACHED_ROW_170
           
protected  boolean skipSystemId
           
 
Fields inherited from class org.hsqldb.lib.HsqlByteArrayOutputStream
buf, count
 
Constructor Summary
RowOutputBase()
          Constructor used for persistent storage of a Table row
RowOutputBase(byte[] buffer)
          Constructor used for network transmission of result sets
RowOutputBase(int initialSize)
          Constructor used for result sets
 
Method Summary
 HsqlByteArrayOutputStream getOutputStream()
           
static RowOutputInterface newRowOutput(int cachedRowType)
           
protected abstract  void writeBigint(Number o)
           
protected abstract  void writeBinary(Binary o, int t)
           
protected abstract  void writeBit(Boolean o)
           
protected abstract  void writeChar(String s, int t)
           
 void writeData(int l, int[] types, Object[] data, HashMappedList cols, boolean primarykeys)
          This method is called to write data for a Result.
 void writeData(Object[] data, Table t)
          This method is called to write data for a table.
protected abstract  void writeDate(Date o)
           
protected abstract  void writeDecimal(BigDecimal o)
           
protected  void writeFieldPrefix()
           
protected abstract  void writeFieldType(int type)
           
abstract  void writeIntData(int i)
           
abstract  void writeIntData(int i, int position)
           
protected abstract  void writeInteger(Number o)
           
protected abstract  void writeNull(int type)
           
protected abstract  void writeOther(JavaObject o)
           
abstract  void writePos(int pos)
           
protected abstract  void writeReal(Double o, int type)
           
abstract  void writeSize(int size)
           
protected abstract  void writeSmallint(Number o)
           
abstract  void writeString(String s)
           
protected abstract  void writeTime(Time o)
           
protected abstract  void writeTimestamp(Timestamp o)
           
abstract  void writeType(int type)
           
 
Methods inherited from class org.hsqldb.lib.HsqlByteArrayOutputStream
close, ensureRoom, fill, flush, getBuffer, reset, reset, size, toByteArray, toString, toString, toString, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeTo, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hsqldb.rowio.RowOutputInterface
getSize, reset, size
 

Field Detail

CACHED_ROW_160

public static final int CACHED_ROW_160
See Also:
Constant Field Values

CACHED_ROW_170

public static final int CACHED_ROW_170
See Also:
Constant Field Values

skipSystemId

protected boolean skipSystemId
Constructor Detail

RowOutputBase

public RowOutputBase()
Constructor used for persistent storage of a Table row

Throws:
IOException - when an IO error is encountered

RowOutputBase

public RowOutputBase(int initialSize)
Constructor used for result sets

Throws:
IOException - when an IO error is encountered

RowOutputBase

public RowOutputBase(byte[] buffer)
Constructor used for network transmission of result sets

Throws:
IOException - when an IO error is encountered
Method Detail

newRowOutput

public static RowOutputInterface newRowOutput(int cachedRowType)
                                       throws HsqlException
Throws:
HsqlException

writePos

public abstract void writePos(int pos)
                       throws IOException
Specified by:
writePos in interface RowOutputInterface
Throws:
IOException

writeSize

public abstract void writeSize(int size)
                        throws IOException
Specified by:
writeSize in interface RowOutputInterface
Throws:
IOException

writeType

public abstract void writeType(int type)
                        throws IOException
Specified by:
writeType in interface RowOutputInterface
Throws:
IOException

writeIntData

public abstract void writeIntData(int i)
                           throws IOException
Specified by:
writeIntData in interface RowOutputInterface
Throws:
IOException

writeIntData

public abstract void writeIntData(int i,
                                  int position)
                           throws IOException
Specified by:
writeIntData in interface RowOutputInterface
Throws:
IOException

writeString

public abstract void writeString(String s)
                          throws IOException
Specified by:
writeString in interface RowOutputInterface
Throws:
IOException

writeFieldPrefix

protected void writeFieldPrefix()
                         throws IOException
Throws:
IOException

writeFieldType

protected abstract void writeFieldType(int type)
                                throws IOException
Throws:
IOException

writeNull

protected abstract void writeNull(int type)
                           throws IOException
Throws:
IOException

writeChar

protected abstract void writeChar(String s,
                                  int t)
                           throws IOException
Throws:
IOException

writeSmallint

protected abstract void writeSmallint(Number o)
                               throws IOException,
                                      HsqlException
Throws:
IOException
HsqlException

writeInteger

protected abstract void writeInteger(Number o)
                              throws IOException,
                                     HsqlException
Throws:
IOException
HsqlException

writeBigint

protected abstract void writeBigint(Number o)
                             throws IOException,
                                    HsqlException
Throws:
IOException
HsqlException

writeReal

protected abstract void writeReal(Double o,
                                  int type)
                           throws IOException,
                                  HsqlException
Throws:
IOException
HsqlException

writeDecimal

protected abstract void writeDecimal(BigDecimal o)
                              throws IOException,
                                     HsqlException
Throws:
IOException
HsqlException

writeBit

protected abstract void writeBit(Boolean o)
                          throws IOException,
                                 HsqlException
Throws:
IOException
HsqlException

writeDate

protected abstract void writeDate(Date o)
                           throws IOException,
                                  HsqlException
Throws:
IOException
HsqlException

writeTime

protected abstract void writeTime(Time o)
                           throws IOException,
                                  HsqlException
Throws:
IOException
HsqlException

writeTimestamp

protected abstract void writeTimestamp(Timestamp o)
                                throws IOException,
                                       HsqlException
Throws:
IOException
HsqlException

writeOther

protected abstract void writeOther(JavaObject o)
                            throws IOException,
                                   HsqlException
Throws:
IOException
HsqlException

writeBinary

protected abstract void writeBinary(Binary o,
                                    int t)
                             throws IOException,
                                    HsqlException
Throws:
IOException
HsqlException

writeData

public void writeData(Object[] data,
                      Table t)
               throws IOException,
                      HsqlException
This method is called to write data for a table.

Specified by:
writeData in interface RowOutputInterface
Parameters:
data -
t -
Throws:
IOException
HsqlException

writeData

public void writeData(int l,
                      int[] types,
                      Object[] data,
                      HashMappedList cols,
                      boolean primarykeys)
               throws IOException,
                      HsqlException
This method is called to write data for a Result.

Specified by:
writeData in interface RowOutputInterface
Parameters:
l -
data -
Throws:
IOException
HsqlException

getOutputStream

public HsqlByteArrayOutputStream getOutputStream()
Specified by:
getOutputStream in interface RowOutputInterface


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