public class HttpInputOverHTTP extends HttpInput<ByteBuffer> implements Callback
HttpInput.StateCallback.Adapter| Constructor and Description |
|---|
HttpInputOverHTTP(HttpConnection httpConnection) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
blockForContent()
Blocks until some content or some end-of-file event arrives.
|
protected void |
consume(ByteBuffer item,
int length)
Consumes the given content.
|
void |
content(ByteBuffer item)
Adds some content to this input stream.
|
void |
failed(Throwable x)
Callback invoked when the operation fails.
|
protected int |
get(ByteBuffer item,
byte[] buffer,
int offset,
int length)
Copies the given content into the given byte buffer.
|
protected ByteBuffer |
nextContent()
Access the next content to be consumed from.
|
void |
recycle() |
protected int |
remaining(ByteBuffer item) |
void |
succeeded()
Callback invoked when the operation completes.
|
String |
toString() |
protected void |
unready() |
available, consumeAll, earlyEOF, getContentRead, getNextContent, init, isAsync, isEarlyEOF, isEOF, isFinished, isReady, lock, messageComplete, onAsyncRead, read, read, run, setReadListenerreadLineclose, mark, markSupported, read, reset, skippublic HttpInputOverHTTP(HttpConnection httpConnection)
httpConnection - public void recycle()
recycle in class HttpInput<ByteBuffer>protected void blockForContent()
throws IOException
HttpInputblockForContent in class HttpInput<ByteBuffer>IOException - if the wait is interruptedprotected ByteBuffer nextContent() throws IOException
HttpInputHttpInput.get(Object, byte[], int, int)
or HttpInput.consume(Object, int) are required to consume data from the content.nextContent in class HttpInput<ByteBuffer>IOException - if retrieving the content failsprotected int remaining(ByteBuffer item)
remaining in class HttpInput<ByteBuffer>item - the contentprotected int get(ByteBuffer item, byte[] buffer, int offset, int length)
HttpInputget in class HttpInput<ByteBuffer>item - the content to copy frombuffer - the buffer to copy intooffset - the buffer offset to start copying fromlength - the space available in the bufferprotected void consume(ByteBuffer item, int length)
HttpInputconsume in class HttpInput<ByteBuffer>item - the content to consumelength - the number of bytes to consumepublic void content(ByteBuffer item)
HttpInputcontent in class HttpInput<ByteBuffer>item - the content to addprotected void unready()
unready in class HttpInput<ByteBuffer>public void succeeded()
CallbackCallback invoked when the operation completes.
succeeded in interface CallbackCallback.failed(Throwable)Copyright © 1995-2015 Webtide. All Rights Reserved.