|
|||||||||
| 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 SocketChannel

java.lang.Objectjava.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.SocketChannel
- All Implemented Interfaces:
- ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, WritableByteChannel
- public abstract class SocketChannel
- 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 |
SocketChannel(java.nio.channels.spi.SelectorProvider provider)
Initializes this socket channel. |
| Method Summary | |
abstract boolean |
connect(java.net.SocketAddress remote)
Connects the channel's socket to the remote address. |
abstract boolean |
finishConnect()
Finishes the process of connecting a socket channel. |
abstract boolean |
isConnected()
Tells whether or not the channel's socket is connected. |
abstract boolean |
isConnectionPending()
Tells whether or not a connection operation is in progress on this channel. |
static SocketChannel |
open()
Opens a socket channel. |
static SocketChannel |
open(java.net.SocketAddress remote)
Opens a channel and connects it to a remote address. |
abstract int |
read(java.nio.ByteBuffer dst)
Reads data from the channel. |
long |
read(java.nio.ByteBuffer[] dsts)
Reads data from the channel. |
abstract long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length)
Reads data from the channel. |
abstract java.net.Socket |
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 the channel. |
long |
write(java.nio.ByteBuffer[] dsts)
Writes data to the channel. |
abstract long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
Writes data to the 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 |
SocketChannel
protected SocketChannel(java.nio.channels.spi.SelectorProvider provider)
- Initializes this socket channel.
| Method Detail |
open
public static SocketChannel open() throws java.io.IOException
- Opens a socket channel.
open
public static SocketChannel open(java.net.SocketAddress remote) throws java.io.IOException
- Opens a channel and connects it to a remote address.
read
public final long read(java.nio.ByteBuffer[] dsts) throws java.io.IOException
- Reads data from the channel.
- Specified by:
readin interfaceScatteringByteChannel
write
public final long write(java.nio.ByteBuffer[] dsts) throws java.io.IOException
- Writes data to the channel.
- Specified by:
writein interfaceGatheringByteChannel
validOps
public final int validOps()
- Retrieves the valid operations for this channel.
- Specified by:
validOpsin classSelectableChannel
read
public abstract int read(java.nio.ByteBuffer dst) throws java.io.IOException
- Reads data from the channel.
- Specified by:
readin interfaceReadableByteChannel
connect
public abstract boolean connect(java.net.SocketAddress remote) throws java.io.IOException
- Connects the channel's socket to the remote address.
finishConnect
public abstract boolean finishConnect()
throws java.io.IOException
- Finishes the process of connecting a socket channel.
isConnected
public abstract boolean isConnected()
- Tells whether or not the channel's socket is connected.
isConnectionPending
public abstract boolean isConnectionPending()
- Tells whether or not a connection operation is in progress on this channel.
read
public abstract long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
- Reads data from the channel.
- Specified by:
readin interfaceScatteringByteChannel
socket
public abstract java.net.Socket socket()
- Retrieves the channel's socket.
write
public abstract int write(java.nio.ByteBuffer src) throws java.io.IOException
- Writes data to the 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 the channel.
- Specified by:
writein interfaceGatheringByteChannel
|
|||||||||
| Home >> All >> java >> nio >> [ channels overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC