-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.InterruptibleChannel,java.nio.channels.NetworkChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,java.nio.channels.WritableByteChannel
public class BaseDelegatingSocketChannel<T extends SocketChannel> extends SocketChannel
Implements a
SocketChannelwhich delegates (its method calls) to anotherSocketChannel. In other words, the former wraps the latter.
-
-
Constructor Summary
Constructors Constructor Description BaseDelegatingSocketChannel(T delegate)Initializes a new BaseDelegatingSocketChannelinstance which is to delegate (its method calls) to a specificSocketChannel.
-
Method Summary
Modifier and Type Method Description SocketChannelbind(SocketAddress local)Forwards to delegate and returns this.booleanconnect(SocketAddress remote)Forwards to delegate. booleanfinishConnect()Forwards to delegate. SocketAddressgetLocalAddress()Forwards to delegate. <U> UgetOption(SocketOption<U> name)Forwards to delegate. SocketAddressgetRemoteAddress()Forwards to delegate. booleanisConnected()Forwards to delegate. booleanisConnectionPending()Forwards to delegate. intread(ByteBuffer dst)Forwards to delegate. longread(Array<ByteBuffer> dsts, int offset, int length)Forwards to delegate. <U> SocketChannelsetOption(SocketOption<U> name, U value)Forwards to delegate and returns this.SocketChannelshutdownInput()Forwards to delegate and returns this.SocketChannelshutdownOutput()Forwards to delegate and returns this.Socketsocket()Allows wrapping the socketof delegate.Set<SocketOption<out Object>>supportedOptions()Forwards to delegate. intwrite(ByteBuffer src)Forwards to delegate. longwrite(Array<ByteBuffer> srcs, int offset, int length)Forwards to delegate. -
Methods inherited from class java.nio.channels.SocketChannel
open, validOps -
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, isBlocking, isRegistered, keyFor, provider, register -
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
close, isOpen -
Methods inherited from class java.nio.channels.NetworkChannel
bind, setOption -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BaseDelegatingSocketChannel
BaseDelegatingSocketChannel(T delegate)
Initializes a newBaseDelegatingSocketChannelinstance which is to delegate (its method calls) to a specificSocketChannel.- Parameters:
delegate- theSocketChannelthe new instance is to delegate (its method calls) to
-
-
Method Detail
-
bind
SocketChannel bind(SocketAddress local)
Forwards to delegate and returns
this.
-
connect
boolean connect(SocketAddress remote)
Forwards to delegate.
-
finishConnect
boolean finishConnect()
Forwards to delegate.
-
getLocalAddress
SocketAddress getLocalAddress()
Forwards to delegate.
-
getOption
<U> U getOption(SocketOption<U> name)
Forwards to delegate.
-
getRemoteAddress
SocketAddress getRemoteAddress()
Forwards to delegate.
-
isConnected
boolean isConnected()
Forwards to delegate.
-
isConnectionPending
boolean isConnectionPending()
Forwards to delegate.
-
read
int read(ByteBuffer dst)
Forwards to delegate.
-
read
long read(Array<ByteBuffer> dsts, int offset, int length)
Forwards to delegate.
-
setOption
<U> SocketChannel setOption(SocketOption<U> name, U value)
Forwards to delegate and returns
this.
-
shutdownInput
SocketChannel shutdownInput()
Forwards to delegate and returns
this.
-
shutdownOutput
SocketChannel shutdownOutput()
Forwards to delegate and returns
this.
-
supportedOptions
Set<SocketOption<out Object>> supportedOptions()
Forwards to delegate.
-
write
int write(ByteBuffer src)
Forwards to delegate.
-
write
long write(Array<ByteBuffer> srcs, int offset, int length)
Forwards to delegate.
-
-
-
-