Interface BinaryNIOInputSource
-
- All Superinterfaces:
org.glassfish.grizzly.InputSource
- All Known Implementing Classes:
NIOInputStream
public interface BinaryNIOInputSource extends org.glassfish.grizzly.InputSourceAdds the ability for binary basedInputSources to obtain the incomingBufferdirectly without having to use intermediate objects to copy the data to.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.glassfish.grizzly.BuffergetBuffer()Returns the the duplicate of the underlyingBufferthat backs thisInputSource.org.glassfish.grizzly.BufferreadBuffer()Returns the underlyingBufferthat backs thisInputSource.org.glassfish.grizzly.BufferreadBuffer(int size)Returns theBufferof a given size, which represents a chunk of the underlyingBufferthat backs thisInputSource.
-
-
-
Method Detail
-
getBuffer
org.glassfish.grizzly.Buffer getBuffer()
Returns the the duplicate of the underlying
Bufferthat backs thisInputSource. 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
Bufferthat backs thisInputSource.
-
readBuffer
org.glassfish.grizzly.Buffer readBuffer()
Returns the underlying
Bufferthat backs thisInputSource. UnlikegetBuffer(), this method detaches the returnedBuffer, so user becomes responsible for handling theBuffer's life-cycle.- Returns:
- the underlying
Bufferthat backs thisInputSource.
-
readBuffer
org.glassfish.grizzly.Buffer readBuffer(int size)
Returns the
Bufferof a given size, which represents a chunk of the underlyingBufferthat backs thisInputSource. UnlikegetBuffer(), this method detaches the returnedBuffer, so user becomes responsible for handling theBuffer's life-cycle.- Parameters:
size- the requested size of theBufferto be returned.- Returns:
- the
Bufferof a given size, which represents a chunk of the underlyingBufferwhich contains incoming request data. This method detaches the returnedBuffer, so user code becomes responsible for handling its life-cycle.
-
-