Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.nio.channels
Class DatagramChannel  view DatagramChannel download DatagramChannel.java

java.lang.Object
  extended byjava.nio.channels.spi.AbstractInterruptibleChannel
      extended byjava.nio.channels.SelectableChannel
          extended byjava.nio.channels.spi.AbstractSelectableChannel
              extended byjava.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

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:
read in interface ScatteringByteChannel

write

public final long write(java.nio.ByteBuffer[] srcs)
                 throws java.io.IOException
Writes data to this channel.

Specified by:
write in interface GatheringByteChannel

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:
read in interface ReadableByteChannel

read

public abstract long read(java.nio.ByteBuffer[] dsts,
                          int offset,
                          int length)
                   throws java.io.IOException
Reads data from this channel.

Specified by:
read in interface ScatteringByteChannel

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:
write in interface WritableByteChannel

write

public abstract long write(java.nio.ByteBuffer[] srcs,
                           int offset,
                           int length)
                    throws java.io.IOException
Writes data to this channel.

Specified by:
write in interface GatheringByteChannel

validOps

public final int validOps()
Retrieves the valid operations for this channel.

Specified by:
validOps in class SelectableChannel