public class HttpInputOverHTTP extends HttpInput<ByteBuffer> implements Callback
HttpInput.State
Callback.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, setReadListener
readLine
close, mark, markSupported, read, reset, skip
public HttpInputOverHTTP(HttpConnection httpConnection)
httpConnection
- public void recycle()
recycle
in class HttpInput<ByteBuffer>
protected void blockForContent() throws IOException
HttpInput
blockForContent
in class HttpInput<ByteBuffer>
IOException
- if the wait is interruptedprotected ByteBuffer nextContent() throws IOException
HttpInput
HttpInput.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)
HttpInput
get
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)
HttpInput
consume
in class HttpInput<ByteBuffer>
item
- the content to consumelength
- the number of bytes to consumepublic void content(ByteBuffer item)
HttpInput
content
in class HttpInput<ByteBuffer>
item
- the content to addprotected void unready()
unready
in class HttpInput<ByteBuffer>
public void succeeded()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
Callback.failed(Throwable)
Copyright © 1995-2015 Webtide. All Rights Reserved.