public class Transfer
extends java.lang.Object
| Constructor and Description |
|---|
Transfer(SessionInterface 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.
|
void |
init()
Initialize the transfer object.
|
boolean |
isClosed() |
Transfer |
openNewConnection()
Open a new new connection to the same address and port as this one.
|
boolean |
readBoolean()
Read a boolean.
|
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.
|
java.lang.String |
readString()
Read a string.
|
Value |
readValue()
Read a value.
|
void |
setSession(SessionInterface 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 |
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 |
writeString(java.lang.String s)
Write a string.
|
void |
writeValue(Value v)
Write a value.
|
public Transfer(SessionInterface session, java.net.Socket s)
session - the sessions - the socketpublic void init()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic Transfer writeBoolean(boolean x) throws java.io.IOException
x - the valuejava.io.IOExceptionpublic boolean readBoolean()
throws java.io.IOException
java.io.IOExceptionpublic Transfer writeInt(int x) throws java.io.IOException
x - the valuejava.io.IOExceptionpublic int readInt()
throws java.io.IOException
java.io.IOExceptionpublic Transfer writeLong(long x) throws java.io.IOException
x - the valuejava.io.IOExceptionpublic long readLong()
throws java.io.IOException
java.io.IOExceptionpublic Transfer writeString(java.lang.String s) throws java.io.IOException
s - the valuejava.io.IOExceptionpublic java.lang.String readString()
throws java.io.IOException
java.io.IOExceptionpublic Transfer writeBytes(byte[] data) throws java.io.IOException
data - the valuejava.io.IOExceptionpublic Transfer writeBytes(byte[] buff, int off, int len) throws java.io.IOException
buff - the valueoff - the offsetlen - the lengthjava.io.IOExceptionpublic byte[] readBytes()
throws java.io.IOException
java.io.IOExceptionpublic 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.IOExceptionpublic void close()
public void writeValue(Value v) throws java.io.IOException
v - the valuejava.io.IOExceptionpublic Value readValue() throws java.io.IOException
java.io.IOExceptionpublic java.net.Socket getSocket()
public void setSession(SessionInterface session)
session - the sessionpublic void setSSL(boolean ssl)
ssl - the new valuepublic Transfer openNewConnection() throws java.io.IOException
java.io.IOExceptionpublic void setVersion(int version)
public boolean isClosed()
public void verifyLobMac(byte[] hmac,
long lobId)
hmac - the message authentication codelobId - the lobIdDbException - if the HMAC does not match