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
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 byte[] readBytes() throws IOException
IOException
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()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.