org.jetlang.web

## Class NioReader<T>

- java.lang.Object
- - org.jetlang.web.NioReader<T>

All Implemented Interfaces:
  org.jetlang.fibers.NioChannelHandler

    public class NioReader<T>
    extends Object
    implements org.jetlang.fibers.NioChannelHandler

### Nested Class Summary

Nested Classes
`static class` `NioReader.Close`
`static interface` `NioReader.State`

### Field Summary

Fields
`static NioReader.State` `CLOSE`

### Constructor Summary

Constructors
Constructor and Description
`NioReader(SocketChannel channel, org.jetlang.fibers.NioFiber fiber, org.jetlang.fibers.NioControls controls, HttpRequestHandler<T> handler, int readBufferSizeInBytes, int maxReadLoops, SessionFactory<T> fact, SessionDispatcherFactory<T> dispatcherFact)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static ByteBuffer` `bufferAllocate(int size)`
`static ByteBuffer` `bufferAllocateDirect(int size)`
`SelectableChannel` `getChannel()`
`int` `getInterestSet()`
`void` `onClosed()`
`void` `onEnd()`
`boolean` `onRead()`
`boolean` `onSelect(org.jetlang.fibers.NioFiber nioFiber, org.jetlang.fibers.NioControls nioControls, SelectionKey selectionKey)`
`void` `onSelectorEnd()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CLOSE

    public static final NioReader.State CLOSE

### Constructor Detail

#### NioReader

    public NioReader(SocketChannel channel,
                     org.jetlang.fibers.NioFiber fiber,
                     org.jetlang.fibers.NioControls controls,
                     HttpRequestHandler<T> handler,
                     int readBufferSizeInBytes,
                     int maxReadLoops,
                     SessionFactory<T> fact,
                     SessionDispatcherFactory<T> dispatcherFact)

### Method Detail

#### onRead

    public boolean onRead()
                   throws IOException

Throws:
  `IOException`

#### bufferAllocate

    public static ByteBuffer bufferAllocate(int size)

#### bufferAllocateDirect

    public static ByteBuffer bufferAllocateDirect(int size)

#### onClosed

    public void onClosed()

#### onSelect

    public boolean onSelect(org.jetlang.fibers.NioFiber nioFiber,
                            org.jetlang.fibers.NioControls nioControls,
                            SelectionKey selectionKey)

Specified by:
  `onSelect` in interface `org.jetlang.fibers.NioChannelHandler`

#### getChannel

    public SelectableChannel getChannel()

Specified by:
  `getChannel` in interface `org.jetlang.fibers.NioChannelHandler`

#### getInterestSet

    public int getInterestSet()

Specified by:
  `getInterestSet` in interface `org.jetlang.fibers.NioChannelHandler`

#### onEnd

    public void onEnd()

Specified by:
  `onEnd` in interface `org.jetlang.fibers.NioChannelHandler`

#### onSelectorEnd

    public void onSelectorEnd()

Specified by:
  `onSelectorEnd` in interface `org.jetlang.fibers.NioChannelHandler`