Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public abstract class DatagramChannel
extends AbstractSelectableChannel
implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
Constructor Summary | |
|
Method Summary | |
abstract DatagramChannel |
|
abstract DatagramChannel |
|
abstract boolean |
|
static DatagramChannel |
|
abstract int |
|
long |
|
abstract long |
|
abstract SocketAddress |
|
abstract int |
|
abstract DatagramSocket |
|
int |
|
abstract int |
|
long |
|
abstract long |
|
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 | |
blockingLock , configureBlocking , isBlocking , isRegistered , keyFor , provider , register , register , validOps |
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel | |
begin , close , end , implCloseChannel , isOpen |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public abstract DatagramChannel connect(SocketAddress remote) throws IOException
Connects this channel's socket.
- Throws:
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
Disonnects this channel's socket.
- Throws:
IOException
- If an error occurs
public abstract boolean isConnected()
Tells whether or not this channel's socket is connected.
- Throws:
NotYetConnectedException
- The channel's socket is not connected.
public static DatagramChannel open() throws IOException
Opens a datagram channel.
- Throws:
IOException
- If an error occurs
public abstract int read(ByteBuffer dst) throws IOException
Reads data from this channel.
- Specified by:
- read in interface ReadableByteChannel
public final long read(ByteBuffer[] dsts) throws IOException
Reads data from this channel.
- Specified by:
- read in interface ScatteringByteChannel
public abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException
Reads data from this channel.
- Specified by:
- read in interface ScatteringByteChannel
- Throws:
IOException
- If an error occurs.NotYetConnectedException
- The channel's socket is not connected.
public abstract SocketAddress receive(ByteBuffer dst) throws IOException
Receives a datagram via this channel.
- Throws:
IOException
- If an error occursSecurityException
- 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
Sends a datagram via this channel.
- Throws:
IOException
- If an error occursSecurityException
- If a security manager has been installed and it does not permit datagrams to be sent to the given address.
public final int validOps()
Retrieves the valid operations for this channel.
- Overrides:
- validOps in interface SelectableChannel
- Throws:
NotYetConnectedException
- The channel's socket is not connected.
public abstract int write(ByteBuffer src) throws IOException
Writes data to this channel.
- Specified by:
- write in interface WritableByteChannel
- Throws:
IOException
- If an error occurs.NotYetConnectedException
- The channel's socket is not connected.
public final long write(ByteBuffer[] srcs) throws IOException
Writes data to this channel.
- Specified by:
- write in interface GatheringByteChannel
- Throws:
IOException
- If an error occursNotYetConnectedException
- The channel's socket is not connected.
public abstract long write(ByteBuffer[] srcs, int offset, int length) throws IOException
Writes data to this channel.
- Specified by:
- write in interface GatheringByteChannel
- Throws:
IOException
- If an error occurs.NotYetConnectedException
- The channel's socket is not connected.