public class NamedChannel
extends java.lang.Object
implements java.nio.channels.ByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.channels.SocketChannel |
channel |
| Constructor and Description |
|---|
NamedChannel(java.nio.channels.SocketChannel channel) |
NamedChannel(java.nio.channels.SocketChannel channel,
NameIdPair nameIdPair) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.nio.channels.SocketChannel |
getChannel() |
NameIdPair |
getNameIdPair() |
boolean |
isOpen() |
int |
read(java.nio.ByteBuffer dst) |
void |
setNameIdPair(NameIdPair nameIdPair) |
java.lang.String |
toString() |
int |
write(java.nio.ByteBuffer src) |
public NamedChannel(java.nio.channels.SocketChannel channel,
NameIdPair nameIdPair)
public NamedChannel(java.nio.channels.SocketChannel channel)
public void setNameIdPair(NameIdPair nameIdPair)
public NameIdPair getNameIdPair()
public java.nio.channels.SocketChannel getChannel()
public java.lang.String toString()
toString in class java.lang.Objectpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChanneljava.io.IOExceptionCopyright (c) 2004-2012 Oracle. All rights reserved.