org.restlet.engine.io
Class ReadableSocketChannel

java.lang.Object
  extended by org.restlet.engine.io.WrapperChannel<SocketChannel>
      extended by org.restlet.engine.io.WrapperSocketChannel
          extended by org.restlet.engine.io.ReadableSocketChannel
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel, BlockableChannel, ReadableSelectionChannel, SelectionChannel

public class ReadableSocketChannel
extends WrapperSocketChannel
implements ReadableSelectionChannel

Readable byte channel based on a source socket channel that must only be partially read.


Constructor Summary
ReadableSocketChannel(SocketChannel wrappedChannel, SelectionRegistration registration)
          Constructor.
 
Method Summary
 int read(ByteBuffer dst)
          Reads the available byte form the wrapped socket channel.
 
Methods inherited from class org.restlet.engine.io.WrapperSocketChannel
getRegistration, isBlocking
 
Methods inherited from class org.restlet.engine.io.WrapperChannel
close, getWrappedChannel, isOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.restlet.engine.io.SelectionChannel
getRegistration
 
Methods inherited from interface org.restlet.engine.io.BlockableChannel
isBlocking
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Constructor Detail

ReadableSocketChannel

public ReadableSocketChannel(SocketChannel wrappedChannel,
                             SelectionRegistration registration)
Constructor.

Parameters:
wrappedChannel - The source channel.
registration - The NIO registration.
Method Detail

read

public int read(ByteBuffer dst)
         throws IOException
Reads the available byte form the wrapped socket channel.

Specified by:
read in interface ReadableByteChannel
Parameters:
dst - The destination byte buffer.
Returns:
The number of bytes read.
Throws:
IOException


Copyright © 2005-2013 Restlet.