public class ChunkedInputFilter extends Object implements InputFilter
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
Read bytes buffer.
|
protected InputBuffer |
buffer
Next buffer in the pipeline.
|
protected static ByteChunk |
ENCODING |
protected static String |
ENCODING_NAME |
protected boolean |
endChunk
Flag set to true when the end chunk has been read.
|
protected int |
lastValid
Last valid byte in the buffer.
|
protected boolean |
needCRLFParse
Flag set to true if the next call to doRead() must parse a CRLF pair
before doing anything else.
|
protected int |
pos
Position in the buffer.
|
protected ByteChunk |
readChunk
Byte chunk used to read bytes.
|
protected int |
remaining
Number of bytes remaining in the current chunk.
|
Constructor and Description |
---|
ChunkedInputFilter() |
Modifier and Type | Method and Description |
---|---|
int |
available()
Amount of bytes still available in a buffer.
|
int |
doRead(ByteChunk chunk,
Request req)
Read bytes.
|
long |
end()
End the current request.
|
ByteChunk |
getEncodingName()
Return the name of the associated encoding; Here, the value is
"identity".
|
protected boolean |
parseChunkHeader()
Parse the header of a chunk.
|
protected boolean |
parseCRLF()
Parse CRLF at end of chunk.
|
protected boolean |
parseEndChunk()
Parse end chunk data.
|
protected int |
readBytes()
Read bytes from the previous buffer.
|
void |
recycle()
Make the filter ready to process the next request.
|
void |
setBuffer(InputBuffer buffer)
Set the next buffer in the filter pipeline.
|
void |
setRequest(Request request)
Read the content length from the request.
|
protected static final String ENCODING_NAME
protected static final ByteChunk ENCODING
protected InputBuffer buffer
protected int remaining
protected int pos
protected int lastValid
protected byte[] buf
protected ByteChunk readChunk
protected boolean endChunk
protected boolean needCRLFParse
public int doRead(ByteChunk chunk, Request req) throws IOException
doRead
in interface InputFilter
doRead
in interface InputBuffer
IOException
public void setRequest(Request request)
setRequest
in interface InputFilter
public long end() throws IOException
end
in interface InputFilter
IOException
public int available()
available
in interface InputFilter
public void setBuffer(InputBuffer buffer)
setBuffer
in interface InputFilter
public void recycle()
recycle
in interface InputFilter
public ByteChunk getEncodingName()
getEncodingName
in interface InputFilter
protected int readBytes() throws IOException
IOException
protected boolean parseChunkHeader() throws IOException
IOException
protected boolean parseCRLF() throws IOException
IOException
protected boolean parseEndChunk() throws IOException
IOException
Copyright © 2015 JBoss by Red Hat. All rights reserved.