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.
|
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) |
Transfer |
writeBoolean(boolean x)
Write a boolean.
|
Transfer |
writeBytes(byte[] data)
Write a byte array.
|
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
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic Transfer writeBoolean(boolean x) throws IOException
x - the valueIOExceptionpublic boolean readBoolean()
throws IOException
IOExceptionpublic Transfer writeInt(int x) throws IOException
x - the valueIOExceptionpublic int readInt()
throws IOException
IOExceptionpublic Transfer writeLong(long x) throws IOException
x - the valueIOExceptionpublic long readLong()
throws IOException
IOExceptionpublic Transfer writeString(String s) throws IOException
s - the valueIOExceptionpublic String readString() throws IOException
IOExceptionpublic Transfer writeBytes(byte[] data) throws IOException
data - the valueIOExceptionpublic byte[] readBytes()
throws IOException
IOExceptionpublic void close()
public void writeValue(Value v) throws IOException
v - the valueIOExceptionpublic Value readValue() throws IOException
IOExceptionpublic Socket getSocket()
public void setSession(SessionInterface session)
session - the sessionpublic void setSSL(boolean ssl)
ssl - the new valuepublic Transfer openNewConnection() throws IOException
IOExceptionpublic void setVersion(int version)
public boolean isClosed()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.