T - public abstract class HttpInput<T> extends ServletInputStream implements Runnable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
HttpInput.State |
| Modifier and Type | Field and Description |
|---|---|
protected HttpInput.State |
_state |
protected static HttpInput.State |
ASYNC |
protected static HttpInput.State |
BLOCKING |
protected static HttpInput.State |
EARLY_EOF |
protected static HttpInput.State |
EOF |
| Modifier | Constructor and Description |
|---|---|
protected |
HttpInput() |
protected |
HttpInput(Object lock) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
protected abstract void |
blockForContent() |
protected abstract void |
consume(T item,
int length) |
void |
consumeAll() |
abstract void |
content(T item)
Add some content to the input stream
|
void |
earlyEOF()
This method should be called to signal to the HttpInput
that an EOF has arrived before all the expected content.
|
void |
failed(Throwable x) |
protected abstract int |
get(T item,
byte[] buffer,
int offset,
int length) |
long |
getContentRead() |
protected T |
getNextContent()
A convenience method to call nextContent and to check the return value, which if null then the
a check is made for EOF and the state changed accordingly.
|
void |
init(HttpChannelState state) |
boolean |
isFinished() |
boolean |
isReady() |
Object |
lock() |
void |
messageComplete() |
protected abstract T |
nextContent()
Access the next content to be consumed from.
|
protected boolean |
onAsyncRead() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
recycle() |
protected abstract int |
remaining(T item) |
void |
run() |
void |
setReadListener(ReadListener readListener) |
protected void |
unready() |
readLineclose, mark, markSupported, read, reset, skipprotected HttpInput.State _state
protected static final HttpInput.State BLOCKING
protected static final HttpInput.State ASYNC
protected static final HttpInput.State EARLY_EOF
protected static final HttpInput.State EOF
protected HttpInput()
protected HttpInput(Object lock)
public final Object lock()
public void recycle()
protected abstract T nextContent() throws IOException
get(Object, byte[], int, int)
or consume(Object, int) are required to consume data from the content.IOExceptionprotected T getNextContent() throws IOException
IOExceptionnextContent()public int read()
throws IOException
read in class InputStreamIOExceptionpublic int available()
available in class InputStreampublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionprotected abstract int remaining(T item)
protected abstract int get(T item, byte[] buffer, int offset, int length)
protected abstract void consume(T item, int length)
protected abstract void blockForContent()
throws IOException
IOExceptionprotected boolean onAsyncRead()
public long getContentRead()
public abstract void content(T item)
item - public void earlyEOF()
public void messageComplete()
public void consumeAll()
public boolean isFinished()
isFinished in class ServletInputStreampublic boolean isReady()
isReady in class ServletInputStreamprotected void unready()
public void setReadListener(ReadListener readListener)
setReadListener in class ServletInputStreampublic void failed(Throwable x)
public void init(HttpChannelState state)
Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.