public final class Transfer
extends java.lang.Object
| Constructor and Description |
|---|
Transfer(Session session,
java.net.Socket s)
Create a new transfer object for the specified session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the transfer object and the socket.
|
void |
flush()
Write pending changes.
|
java.net.Socket |
getSocket()
Get the socket.
|
int |
getVersion() |
void |
init()
Initialize the transfer object.
|
boolean |
isClosed() |
Transfer |
openNewConnection()
Open a new connection to the same address and port as this one.
|
boolean |
readBoolean()
Read a boolean.
|
byte |
readByte()
Read a byte.
|
byte[] |
readBytes()
Read a byte array.
|
void |
readBytes(byte[] buff,
int off,
int len)
Read a number of bytes.
|
int |
readInt()
Read an int.
|
long |
readLong()
Read a long.
|
long |
readRowCount()
Read a row count.
|
java.lang.String |
readString()
Read a string.
|
TypeInfo |
readTypeInfo()
Read a type information.
|
Value |
readValue(TypeInfo columnType)
Read a value.
|
void |
setSession(Session session)
Set the session.
|
void |
setSSL(boolean ssl)
Enable or disable SSL.
|
void |
setVersion(int version) |
void |
verifyLobMac(byte[] hmac,
long lobId)
Verify the HMAC.
|
Transfer |
writeBoolean(boolean x)
Write a boolean.
|
Transfer |
writeByte(byte x)
Write a byte.
|
Transfer |
writeBytes(byte[] data)
Write a byte array.
|
Transfer |
writeBytes(byte[] buff,
int off,
int len)
Write a number of bytes.
|
Transfer |
writeInt(int x)
Write an int.
|
Transfer |
writeLong(long x)
Write a long.
|
Transfer |
writeRowCount(long rowCount)
Write a row count.
|
Transfer |
writeString(java.lang.String s)
Write a string.
|
Transfer |
writeTypeInfo(TypeInfo type)
Write value type, precision, and scale.
|
void |
writeValue(Value v)
Write a value.
|
public Transfer(Session session, java.net.Socket s)
session - the sessions - the socketpublic void init()
throws java.io.IOException
java.io.IOException - on failurepublic void flush()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeBoolean(boolean x) throws java.io.IOException
x - the valuejava.io.IOException - on failurepublic boolean readBoolean()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeByte(byte x) throws java.io.IOException
x - the valuejava.io.IOException - on failurepublic byte readByte()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeInt(int x) throws java.io.IOException
x - the valuejava.io.IOException - on failurepublic int readInt()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeLong(long x) throws java.io.IOException
x - the valuejava.io.IOException - on failurepublic long readLong()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeString(java.lang.String s) throws java.io.IOException
s - the valuejava.io.IOException - on failurepublic java.lang.String readString()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeBytes(byte[] data) throws java.io.IOException
data - the valuejava.io.IOException - on failurepublic Transfer writeBytes(byte[] buff, int off, int len) throws java.io.IOException
buff - the valueoff - the offsetlen - the lengthjava.io.IOException - on failurepublic byte[] readBytes()
throws java.io.IOException
java.io.IOException - on failurepublic void readBytes(byte[] buff,
int off,
int len)
throws java.io.IOException
buff - the target bufferoff - the offsetlen - the number of bytes to readjava.io.IOException - on failurepublic void close()
public Transfer writeTypeInfo(TypeInfo type) throws java.io.IOException
type - data type informationjava.io.IOException - on failurepublic TypeInfo readTypeInfo() throws java.io.IOException
java.io.IOException - on failurepublic void writeValue(Value v) throws java.io.IOException
v - the valuejava.io.IOException - on failurepublic Value readValue(TypeInfo columnType) throws java.io.IOException
columnType - the data type of value, or nulljava.io.IOException - on failurepublic long readRowCount()
throws java.io.IOException
java.io.IOException - on failurepublic Transfer writeRowCount(long rowCount) throws java.io.IOException
rowCount - the row countjava.io.IOException - on failurepublic java.net.Socket getSocket()
public void setSession(Session session)
session - the sessionpublic void setSSL(boolean ssl)
ssl - the new valuepublic Transfer openNewConnection() throws java.io.IOException
java.io.IOException - on failurepublic void setVersion(int version)
public int getVersion()
public boolean isClosed()
public void verifyLobMac(byte[] hmac,
long lobId)
hmac - the message authentication codelobId - the lobIdDbException - if the HMAC does not match