Top Description Fields Constructors Methods
org.hsqldb.server

pack-priv Class OdbcPacketInputStream

extends DataInputStream
Class Inheritance
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .DataInputStream, .EOFException, .IOException, .InputStream, java.util.HashMap, .Map, org.hsqldb.HsqlException, org.hsqldb.types.BinaryData

An atomic transfer packet received from a HyperSQL client. Since we read and cache all data for the packet upon instantiation, the available method is reliable and may be relied upon.
Author
Blaine Simpson (blaine dot simpson at admc dot com)
Since
1.9.0
See Also
available()

Field Summary

Modifier and TypeField and Description
private InputStream
pack-priv char

Constructor Summary

AccessConstructor and Description
private
OdbcPacketInputStream(char packetType, InputStream bufferStream)

Method Summary

Modifier and TypeMethod and Description
pack-priv static OdbcPacketInputStream
newOdbcPacketInputStream(char cType, InputStream streamSource, int sizeInt)

Instantiate a packet of the specified type and size.

pack-priv static OdbcPacketInputStream
newOdbcPacketInputStream(char cType, InputStream streamSource)

Instantiate a packet of the specified type, with size determined by the first int read from the given stream.

private static OdbcPacketInputStream
newOdbcPacketInputStream(char cType, InputStream streamSource, Integer packetSizeObj)

public char
pack-priv BinaryData
pack-priv String
pack-priv String
readString()

Reads a NULL-TERMINATED String.

pack-priv String
readString(int
Bytes to read (not necessarily characters to be returned!
len
)

These Strings are not null-terminated.

pack-priv Map<String, String>

Returns:

the generated Map
readStringPairs
()

Generate a String/String Map from null-terminated String pairs, until a '\0' character is read in place of the first key character.

Inherited from java.io.DataInputStream:
readreadreadBooleanreadBytereadCharreadDoublereadFloatreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedShortreadUTFreadUTFskipBytes

Field Detail

bufferStreamback to summary
private InputStream bufferStream
packetTypeback to summary
pack-priv char packetType

Constructor Detail

OdbcPacketInputStreamback to summary
private OdbcPacketInputStream(char packetType, InputStream bufferStream)

Method Detail

newOdbcPacketInputStreamback to summary
pack-priv static OdbcPacketInputStream newOdbcPacketInputStream(char cType, InputStream streamSource, int sizeInt) throws IOException

Instantiate a packet of the specified type and size.

newOdbcPacketInputStreamback to summary
pack-priv static OdbcPacketInputStream newOdbcPacketInputStream(char cType, InputStream streamSource) throws IOException

Instantiate a packet of the specified type, with size determined by the first int read from the given stream.

newOdbcPacketInputStreamback to summary
private static OdbcPacketInputStream newOdbcPacketInputStream(char cType, InputStream streamSource, Integer packetSizeObj) throws IOException
readByteCharback to summary
public char readByteChar() throws IOException
readSizedBinaryDataback to summary
pack-priv BinaryData readSizedBinaryData() throws IOException
readSizedStringback to summary
pack-priv String readSizedString() throws IOException
readStringback to summary
pack-priv String readString() throws IOException

Reads a NULL-TERMINATED String.

Exceptions
IOException:
if attempt to read past end of packet.
readStringback to summary
pack-priv String readString(int len) throws IOException

These Strings are not null-terminated.

Parameters
len:int

Bytes to read (not necessarily characters to be returned!

Exceptions
IOException:
if attempt to read past end of packet.
readStringPairsback to summary
pack-priv Map<String, String> readStringPairs() throws IOException

Generate a String/String Map from null-terminated String pairs, until a '\0' character is read in place of the first key character.

Returns:Map<String, String>

the generated Map

Exceptions
EOFException:
if the rest of packet does not contained the required, well-formed null-terminated string pairs.