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() |
readLine
close, mark, markSupported, read, reset, skip
protected 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.IOException
protected T getNextContent() throws IOException
IOException
nextContent()
public int read() throws IOException
read
in class InputStream
IOException
public int available()
available
in class InputStream
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
protected 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
IOException
protected 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 ServletInputStream
public boolean isReady()
isReady
in class ServletInputStream
protected void unready()
public void setReadListener(ReadListener readListener)
setReadListener
in class ServletInputStream
public void failed(Throwable x)
public void init(HttpChannelState state)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.