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.Object
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.WritableByteChannel
java.io.IOException
Copyright (c) 2004-2012 Oracle. All rights reserved.