public class Transfer extends Object
Constructor and Description |
---|
Transfer(SessionInterface session)
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.
|
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.
|
String |
readString()
Read a string.
|
Value |
readValue()
Read a value.
|
void |
setSession(SessionInterface session)
Set the session.
|
void |
setSocket(Socket s)
Set the socket this object uses.
|
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(String s)
Write a string.
|
void |
writeValue(Value v)
Write a value.
|
public Transfer(SessionInterface session)
session
- the sessionpublic void setSocket(Socket s)
s
- the socketpublic void init() throws IOException
IOException
public void flush() throws IOException
IOException
public Transfer writeBoolean(boolean x) throws IOException
x
- the valueIOException
public boolean readBoolean() throws IOException
IOException
public Transfer writeInt(int x) throws IOException
x
- the valueIOException
public int readInt() throws IOException
IOException
public Transfer writeLong(long x) throws IOException
x
- the valueIOException
public long readLong() throws IOException
IOException
public Transfer writeString(String s) throws IOException
s
- the valueIOException
public String readString() throws IOException
IOException
public Transfer writeBytes(byte[] data) throws IOException
data
- the valueIOException
public Transfer writeBytes(byte[] buff, int off, int len) throws IOException
buff
- the valueoff
- the offsetlen
- the lengthIOException
public byte[] readBytes() throws IOException
IOException
public void readBytes(byte[] buff, int off, int len) throws IOException
buff
- the target bufferoff
- the offsetlen
- the number of bytes to readIOException
public void close()
public void writeValue(Value v) throws IOException
v
- the valueIOException
public Value readValue() throws IOException
IOException
public Socket getSocket()
public void setSession(SessionInterface session)
session
- the sessionpublic void setSSL(boolean ssl)
ssl
- the new valuepublic Transfer openNewConnection() throws IOException
IOException
public 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 matchCopyright © 2017 JBoss by Red Hat. All rights reserved.