|
|||||||||
| Home >> All >> java >> nio >> [ channels overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.nio.channels
Class DatagramChannel

java.lang.Objectjava.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.DatagramChannel
- All Implemented Interfaces:
- ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, WritableByteChannel
- public abstract class DatagramChannel
- extends java.nio.channels.spi.AbstractSelectableChannel
- implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
- extends java.nio.channels.spi.AbstractSelectableChannel
- Since:
- 1.4
| Field Summary |
| Fields inherited from class java.nio.channels.spi.AbstractSelectableChannel |
|
| Fields inherited from class java.nio.channels.spi.AbstractInterruptibleChannel |
|
| Constructor Summary | |
protected |
DatagramChannel(java.nio.channels.spi.SelectorProvider provider)
Initializes the channel. |
| Method Summary | |
abstract DatagramChannel |
connect(java.net.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(java.nio.ByteBuffer dst)
Reads data from this channel. |
long |
read(java.nio.ByteBuffer[] dsts)
Reads data from this channel. |
abstract long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length)
Reads data from this channel. |
abstract java.net.SocketAddress |
receive(java.nio.ByteBuffer dst)
Receives a datagram via this channel. |
abstract int |
send(java.nio.ByteBuffer src,
java.net.SocketAddress target)
Sends a datagram via this channel. |
abstract java.net.DatagramSocket |
socket()
Retrieves the channel's socket. |
int |
validOps()
Retrieves the valid operations for this channel. |
abstract int |
write(java.nio.ByteBuffer src)
Writes data to this channel. |
long |
write(java.nio.ByteBuffer[] srcs)
Writes data to this channel. |
abstract long |
write(java.nio.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 |
DatagramChannel
protected DatagramChannel(java.nio.channels.spi.SelectorProvider provider)
- Initializes the channel.
| Method Detail |
open
public static DatagramChannel open() throws java.io.IOException
- Opens a datagram channel.
read
public final long read(java.nio.ByteBuffer[] dsts) throws java.io.IOException
- Reads data from this channel.
- Specified by:
readin interfaceScatteringByteChannel
write
public final long write(java.nio.ByteBuffer[] srcs) throws java.io.IOException
- Writes data to this channel.
- Specified by:
writein interfaceGatheringByteChannel
connect
public abstract DatagramChannel connect(java.net.SocketAddress remote) throws java.io.IOException
- Connects this channel's socket.
disconnect
public abstract DatagramChannel disconnect() throws java.io.IOException
- Disonnects this channel's socket.
isConnected
public abstract boolean isConnected()
- Tells whether or not this channel's socket is connected.
read
public abstract int read(java.nio.ByteBuffer dst) throws java.io.IOException
- Reads data from this channel.
- Specified by:
readin interfaceReadableByteChannel
read
public abstract long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
- Reads data from this channel.
- Specified by:
readin interfaceScatteringByteChannel
receive
public abstract java.net.SocketAddress receive(java.nio.ByteBuffer dst) throws java.io.IOException
- Receives a datagram via this channel.
send
public abstract int send(java.nio.ByteBuffer src, java.net.SocketAddress target) throws java.io.IOException
- Sends a datagram via this channel.
socket
public abstract java.net.DatagramSocket socket()
- Retrieves the channel's socket.
write
public abstract int write(java.nio.ByteBuffer src) throws java.io.IOException
- Writes data to this channel.
- Specified by:
writein interfaceWritableByteChannel
write
public abstract long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
- Writes data to this channel.
- Specified by:
writein interfaceGatheringByteChannel
validOps
public final int validOps()
- Retrieves the valid operations for this channel.
- Specified by:
validOpsin classSelectableChannel
|
|||||||||
| Home >> All >> java >> nio >> [ channels overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC