org.hsqldb.rowio
Class RowOutputBinary
- java.lang.Object
-
- java.io.OutputStream
-
- org.hsqldb.lib.HsqlByteArrayOutputStream
-
- org.hsqldb.rowio.RowOutputBinary
-
- All Implemented Interfaces:
- java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable, java.lang.Cloneable, RowOutputInterface
- Direct Known Subclasses:
- RowOutputBinary180, RowOutputBinaryEncode
public class RowOutputBinary extends HsqlByteArrayOutputStream
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.- Since:
- 1.7.0
-
-
Field Summary
Fields Modifier and Type Field and Description static intCACHED_ROW_160static intCACHED_ROW_170static intINT_STORE_SIZE
-
Constructor Summary
Constructors Constructor and Description RowOutputBinary(byte[] buffer)Constructor used for network transmission of result setsRowOutputBinary(int initialSize, int scale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RowOutputInterfaceduplicate()voidensureRoom(int extra)HsqlByteArrayOutputStreamgetOutputStream()intgetSize(int[] array)intgetSize(java.lang.Object[] data, int l, Type[] types)Calculate the size of byte array required to store a row.intgetSize(Row row)Calculate the size of byte array required to store a row.intgetStorageSize(int size)voidreset()voidreset(byte[] buffer)voidreset(int newSize)voidwriteArray(int[] o)voidwriteByteArray(byte[] b)voidwriteCharArray(char[] c)voidwriteData(int l, Type[] types, java.lang.Object[] data, HashMappedList cols, int[] primaryKeys)This method is called directly to write data for a delete statement.voidwriteData(Row row, Type[] types)This method is called to write data for a table row.voidwriteData(Type t, java.lang.Object o)voidwriteEnd()voidwriteFieldType(Type type)voidwriteIntData(int i, int position)voidwriteNull(Type type)voidwriteSize(int size)voidwriteString(java.lang.String s)voidwriteType(int type)-
Methods inherited from class org.hsqldb.lib.HsqlByteArrayOutputStream
close, fill, flush, getBuffer, setPosition, setSize, size, toByteArray, toString, toString, write, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeNoCheck, writeShort, writeTo, writeUTF
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hsqldb.rowio.RowOutputInterface
getBuffer, size, writeByte, writeChar, writeInt, writeLong, writeShort
-
-
-
-
Field Detail
-
INT_STORE_SIZE
public static final int INT_STORE_SIZE
- See Also:
- Constant Field Values
-
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
-
-
Constructor Detail
-
RowOutputBinary
public RowOutputBinary(int initialSize, int scale)
-
RowOutputBinary
public RowOutputBinary(byte[] buffer)
Constructor used for network transmission of result sets- Parameters:
buffer- byte[]
-
-
Method Detail
-
writeIntData
public void writeIntData(int i, int position)- Specified by:
writeIntDatain interfaceRowOutputInterface
-
writeData
public void writeData(Row row, Type[] types)
This method is called to write data for a table row.- Specified by:
writeDatain interfaceRowOutputInterface
-
writeEnd
public void writeEnd()
- Specified by:
writeEndin interfaceRowOutputInterface
-
writeSize
public void writeSize(int size)
- Specified by:
writeSizein interfaceRowOutputInterface
-
writeType
public void writeType(int type)
- Specified by:
writeTypein interfaceRowOutputInterface
-
writeString
public void writeString(java.lang.String s)
- Specified by:
writeStringin interfaceRowOutputInterface
-
getSize
public int getSize(Row row)
Calculate the size of byte array required to store a row.- Parameters:
row- - a database row- Returns:
- size of byte array
- Throws:
HsqlException- When data is inconsistent
-
getStorageSize
public int getStorageSize(int size)
-
writeFieldType
public void writeFieldType(Type type)
-
writeNull
public void writeNull(Type type)
-
writeArray
public void writeArray(int[] o)
-
writeByteArray
public void writeByteArray(byte[] b)
-
writeCharArray
public void writeCharArray(char[] c)
-
getSize
public int getSize(int[] array)
-
getSize
public int getSize(java.lang.Object[] data, int l, Type[] types)Calculate the size of byte array required to store a row.- Parameters:
data- - the row datal- - number of data[] elements to include in calculationtypes- - array of java.sql.Types values- Returns:
- size of byte array
-
ensureRoom
public void ensureRoom(int extra)
- Overrides:
ensureRoomin classHsqlByteArrayOutputStream- Parameters:
extra- amount of extra space
-
reset
public void reset()
- Specified by:
resetin interfaceRowOutputInterface- Overrides:
resetin classHsqlByteArrayOutputStream
-
reset
public void reset(int newSize)
- Specified by:
resetin interfaceRowOutputInterface- Overrides:
resetin classHsqlByteArrayOutputStream
-
reset
public void reset(byte[] buffer)
- Specified by:
resetin interfaceRowOutputInterface- Overrides:
resetin classHsqlByteArrayOutputStream
-
duplicate
public RowOutputInterface duplicate()
- Specified by:
duplicatein interfaceRowOutputInterface
-
writeData
public void writeData(int l, Type[] types, java.lang.Object[] data, HashMappedList cols, int[] primaryKeys)This method is called directly to write data for a delete statement.- Specified by:
writeDatain interfaceRowOutputInterface
-
writeData
public void writeData(Type t, java.lang.Object o)
-
getOutputStream
public HsqlByteArrayOutputStream getOutputStream()
- Specified by:
getOutputStreamin interfaceRowOutputInterface
-
-
DataMelt 3.0 © DataMelt by jWork.ORG