org.glassfish.grizzly.http.server.io
Interface BinaryNIOInputSource

All Superinterfaces:
NIOInputSource
All Known Implementing Classes:
NIOInputStream

public interface BinaryNIOInputSource
extends NIOInputSource

Adds the ability for binary based NIOInputSources to obtain the incoming Buffer directly without having to use intermediate objects to copy the data to.

Since:
2.0

Method Summary
 Buffer getBuffer()
           Returns the the duplicate of the underlying Buffer that backs this NIOInputSource.
 Buffer readBuffer()
           Returns the underlying Buffer that backs this NIOInputSource.
 Buffer readBuffer(int size)
           Returns the Buffer of a given size, which represents a chunk of the underlying Buffer that backs this NIOInputSource.
 
Methods inherited from interface org.glassfish.grizzly.http.server.io.NIOInputSource
isFinished, isReady, notifyAvailable, notifyAvailable, readyData
 

Method Detail

getBuffer

Buffer getBuffer()

Returns the the duplicate of the underlying Buffer that backs this NIOInputSource. The content of the returned buffer will be that of the underlying buffer. Changes to returned buffer's content will be visible in the underlying buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.

Returns:
the duplicate of the underlying Buffer that backs this NIOInputSource.

readBuffer

Buffer readBuffer()

Returns the underlying Buffer that backs this NIOInputSource. Unlike getBuffer(), this method detaches the returned Buffer, so user becomes responsible for handling the Buffer's life-cycle.

Returns:
the underlying Buffer that backs this NIOInputSource.

readBuffer

Buffer readBuffer(int size)

Returns the Buffer of a given size, which represents a chunk of the underlying Buffer that backs this NIOInputSource. Unlike getBuffer(), this method detaches the returned Buffer, so user becomes responsible for handling the Buffer's life-cycle.

Parameters:
size - the requested size of the Buffer to be returned.
Returns:
the Buffer of a given size, which represents a chunk of the underlying Buffer which contains incoming request data. This method detaches the returned Buffer, so user code becomes responsible for handling its life-cycle.


Copyright © 2012 Oracle Corporation. All Rights Reserved.