Top Description Inners Fields Constructors Methods
io.undertow.conduits

pack-priv Class ChunkReader<T extends Conduit>

extends Object
Class Inheritance
Static Imports
org.xnio.Bits.allAreClear, .Bits.anyAreSet, .Bits.longBitMask

Utility class for reading chunked streams.
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
ChunkReader.TrailerParser

Class that parses HTTP trailers.

Field Summary

Modifier and TypeField and Description
private final Attachable
private final T
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private long
private final AttachmentKey<HeaderMap>
private ChunkReader<T>.TrailerParser
trailerParser

The trailer parser that stores the trailer parse state.

Constructor Summary

AccessConstructor and Description
pack-priv
ChunkReader(final Attachable attachable, final AttachmentKey<HeaderMap> trailerAttachmentKey, T conduit)

Method Summary

Modifier and TypeMethod and Description
public long
private int
public long
readChunk(final ByteBuffer buf)

public void
setChunkRemaining(final long remaining)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attachableback to summary
private final Attachable attachable
conduitback to summary
private final T conduit
FLAG_FINISHEDback to summary
private static final long FLAG_FINISHED
FLAG_READING_AFTER_LASTback to summary
private static final long FLAG_READING_AFTER_LAST
FLAG_READING_LENGTHback to summary
private static final long FLAG_READING_LENGTH
FLAG_READING_NEWLINEback to summary
private static final long FLAG_READING_NEWLINE
FLAG_READING_TILL_END_OF_LINEback to summary
private static final long FLAG_READING_TILL_END_OF_LINE
LIMITback to summary
private static final long LIMIT
MASK_COUNTback to summary
private static final long MASK_COUNT
stateback to summary
private long state
trailerAttachmentKeyback to summary
private final AttachmentKey<HeaderMap> trailerAttachmentKey
trailerParserback to summary
private ChunkReader<T>.TrailerParser trailerParser

The trailer parser that stores the trailer parse state. If this class is not null it means that we are in the middle of parsing trailers.

Constructor Detail

ChunkReaderback to summary
pack-priv ChunkReader(final Attachable attachable, final AttachmentKey<HeaderMap> trailerAttachmentKey, T conduit)

Method Detail

getChunkRemainingback to summary
public long getChunkRemaining()
handleChunkedRequestEndback to summary
private int handleChunkedRequestEnd(ByteBuffer buffer) throws IOException
readChunkback to summary
public long readChunk(final ByteBuffer buf) throws IOException
setChunkRemainingback to summary
public void setChunkRemaining(final long remaining)
io.undertow.conduits back to summary

private final Class ChunkReader.TrailerParser

extends Object
Class Inheritance

Class that parses HTTP trailers. We don't just re-use the http parser code because it is complicated enough already, and this is not used very often so the performance benefits should not matter.

Field Summary

Modifier and TypeField and Description
private StringBuilder
private HeaderMap
private HttpString
pack-priv int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builderback to summary
private StringBuilder builder
headerMapback to summary
private HeaderMap headerMap
httpStringback to summary
private HttpString httpString
stateback to summary
pack-priv int state
STATE_ENDINGback to summary
private static final int STATE_ENDING
STATE_TRAILER_NAMEback to summary
private static final int STATE_TRAILER_NAME
STATE_TRAILER_VALUEback to summary
private static final int STATE_TRAILER_VALUE

Constructor Detail

TrailerParserback to summary
private TrailerParser()

Method Detail

handleback to summary
public int handle(ByteBuffer buf) throws IOException