|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectObjectBufferChannel
public class ObjectBufferChannel
ObjectBufferChannel. This class creates a communication channel using a socket.
Field Summary | |
---|---|
(package private) static int |
DEFAULT_CAPACITY
default capacity for ByteBuffer. |
(package private) java.nio.ByteBuffer |
hbb
heap ByteBuffer. |
(package private) ObjectBuffer |
ob
object ByteBuffer wraper. |
(package private) java.nio.channels.SocketChannel |
soc
socket channel. |
Constructor Summary | |
---|---|
ObjectBufferChannel(java.nio.channels.SocketChannel s)
Constructs a socket channel on the given socket s. |
|
ObjectBufferChannel(java.nio.channels.SocketChannel s,
int cap)
Constructs a socket channel on the given socket s. |
Method Summary | |
---|---|
void |
close()
Closes the channel. |
java.lang.Object |
receive()
Receives an object. |
void |
send(java.lang.Object v)
Sends an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int DEFAULT_CAPACITY
final java.nio.ByteBuffer hbb
final ObjectBuffer ob
final java.nio.channels.SocketChannel soc
Constructor Detail |
---|
public ObjectBufferChannel(java.nio.channels.SocketChannel s, int cap) throws java.io.IOException
s
- socket channel.cap
- capacity of ByteBuffer.
java.io.IOException
public ObjectBufferChannel(java.nio.channels.SocketChannel s) throws java.io.IOException
s
- socket channel.
java.io.IOException
Method Detail |
---|
public void send(java.lang.Object v) throws java.io.IOException
send
in interface ObjectChannel
v
- Object to send.
java.io.IOException
public java.lang.Object receive() throws java.io.IOException, java.lang.ClassNotFoundException
receive
in interface ObjectChannel
java.io.IOException
java.lang.ClassNotFoundException
public void close()
close
in interface ObjectChannel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |