|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.DatagramChannel
public abstract class DatagramChannel
Constructor Summary | |
---|---|
protected |
DatagramChannel(SelectorProvider provider)
Initializes the channel. |
Method Summary | |
---|---|
abstract DatagramChannel |
connect(SocketAddress remote)
Connects this channel's socket. |
abstract DatagramChannel |
disconnect()
Disonnects this channel's socket. |
abstract boolean |
isConnected()
Tells whether or not this channel's socket is connected. |
static DatagramChannel |
open()
Opens a datagram channel. |
abstract int |
read(ByteBuffer dst)
Reads data from this channel. |
long |
read(ByteBuffer[] dsts)
Reads data from this channel. |
abstract long |
read(ByteBuffer[] dsts,
int offset,
int length)
Reads data from this channel. |
abstract SocketAddress |
receive(ByteBuffer dst)
Receives a datagram via this channel. |
abstract int |
send(ByteBuffer src,
SocketAddress target)
Sends a datagram via this channel. |
abstract DatagramSocket |
socket()
Retrieves the channel's socket. |
int |
validOps()
Retrieves the valid operations for this channel. |
abstract int |
write(ByteBuffer src)
Writes data to this channel. |
long |
write(ByteBuffer[] srcs)
Writes data to this channel. |
abstract long |
write(ByteBuffer[] srcs,
int offset,
int length)
Writes data to this channel. |
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel |
---|
blockingLock, configureBlocking, implCloseChannel, implCloseSelectableChannel, implConfigureBlocking, isBlocking, isRegistered, keyFor, provider, register |
Methods inherited from class java.nio.channels.SelectableChannel |
---|
register |
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel |
---|
begin, close, end, isOpen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.nio.channels.Channel |
---|
close, isOpen |
Constructor Detail |
---|
protected DatagramChannel(SelectorProvider provider)
Method Detail |
---|
public static DatagramChannel open() throws IOException
IOException
- If an error occurspublic final long read(ByteBuffer[] dsts) throws IOException
read
in interface ScatteringByteChannel
AsynchronousCloseException
- If another thread closes this
channel while the write operation is in progress
ClosedByInterruptException
- If another thread interrupts the
current thread while the write operation is in progress, thereby closing
the channel and setting the current thread's interrupt status
ClosedChannelException
- If this channel is closed
IOException
- If an error occurspublic final long write(ByteBuffer[] srcs) throws IOException
write
in interface GatheringByteChannel
IOException
- If an error occurs
NotYetConnectedException
- The channel's socket is not connected.public abstract DatagramChannel connect(SocketAddress remote) throws IOException
AsynchronousCloseException
- If another thread closes this channel
while the connect operation is in progress.
ClosedByInterruptException
- If another thread interrupts the
current thread while the read operation is in progress, thereby closing the
channel and setting the current thread's interrupt status.
ClosedChannelException
- If this channel is closed.
IOException
- If an error occurs.
SecurityException
- If a security manager has been installed and
it does not permit datagrams to be sent to the given address.public abstract DatagramChannel disconnect() throws IOException
IOException
- If an error occurspublic abstract boolean isConnected()
NotYetConnectedException
- The channel's socket is not connected.public abstract int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
dst
- the buffer to put the read data into
AsynchronousCloseException
- If another thread closes this
channel while the read operation is in progress
ClosedByInterruptException
- If another thread interrupts the
current thread while the read operation is in progress, thereby closing
the channel and setting the current thread's interrupt status
ClosedChannelException
- If this channel is closed
IOException
- If an error occurspublic abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
IOException
- If an error occurs.
NotYetConnectedException
- The channel's socket is not connected.public abstract SocketAddress receive(ByteBuffer dst) throws IOException
AsynchronousCloseException
- If another thread closes this channel
while the connect operation is in progress.
ClosedByInterruptException
- If another thread interrupts the
current thread while the read operation is in progress, thereby closing the
channel and setting the current thread's interrupt status.
ClosedChannelException
- If this channel is closed.
IOException
- If an error occurs
SecurityException
- If a security manager has been installed and
it does not permit datagrams to be sent to the given address.public abstract int send(ByteBuffer src, SocketAddress target) throws IOException
AsynchronousCloseException
- If another thread closes this channel
while the connect operation is in progress.
ClosedByInterruptException
- If another thread interrupts the
current thread while the read operation is in progress, thereby closing the
channel and setting the current thread's interrupt status.
ClosedChannelException
- If this channel is closed.
IOException
- If an error occurs
SecurityException
- If a security manager has been installed and
it does not permit datagrams to be sent to the given address.public abstract DatagramSocket socket()
public abstract int write(ByteBuffer src) throws IOException
write
in interface WritableByteChannel
IOException
- If an error occurs.
NotYetConnectedException
- The channel's socket is not connected.public abstract long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write
in interface GatheringByteChannel
IOException
- If an error occurs.
NotYetConnectedException
- The channel's socket is not connected.public final int validOps()
validOps
in class SelectableChannel
NotYetConnectedException
- The channel's socket is not connected.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |