collect buffers until frame decoding is possible, all decoded frames are passed to the FrameProcessor callback in order of decoding. It's a stateful class due to the fact that FramesDecoder stores buffers inside. Should be allocated only the single instance per connection.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final int | COPY_THRESHOLD
Threshold beyond which data is no longer copied into the current buffer, if that buffer has enough unused space. |
| private ByteBuffer | |
| pack-priv static final Logger | |
| private int | |
| private boolean | |
| private int | |
| private final FramesDecoder. | |
| private int | |
| private int | |
| private final int | |
| private final List | |
| private boolean | |
| private final ArrayDeque | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | FramesDecoder(FramesDecoder.
- callback for decoded frames frameProcessorCreates Frame Decoder |
| public | FramesDecoder(FramesDecoder.
- callback for decoded frames frameProcessor,- maxFrameSize accepted by this decoder maxFrameSize)Creates Frame Decoder |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | decode(ByteBuffer inBoundBuffer)
Adds the data from the given buffer, and performs frame decoding if possible. |
| private void | |
| private List | |
| public int | |
| public byte[] | |
| public int | |
| public int | |
| pack-priv static boolean | |
| private void | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private void | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| private Http2Frame | |
| public void |
| closed | back to summary |
|---|---|
| private boolean closed | |
| COPY_THRESHOLD | back to summary |
|---|---|
| private static final int COPY_THRESHOLD Threshold beyond which data is no longer copied into the current buffer, if that buffer has enough unused space. | |
| currentBuffer | back to summary |
|---|---|
| private ByteBuffer currentBuffer | |
| debug | back to summary |
|---|---|
| pack-priv static final Logger debug | |
| frameFlags | back to summary |
|---|---|
| private int frameFlags | |
| frameHeaderParsed | back to summary |
|---|---|
| private boolean frameHeaderParsed | |
| frameLength | back to summary |
|---|---|
| private int frameLength | |
| frameProcessor | back to summary |
|---|---|
| private final FramesDecoder. | |
| frameStreamid | back to summary |
|---|---|
| private int frameStreamid | |
| frameType | back to summary |
|---|---|
| private int frameType | |
| maxFrameSize | back to summary |
|---|---|
| private final int maxFrameSize | |
| prepareToRelease | back to summary |
|---|---|
| private final List<ByteBuffer> prepareToRelease | |
| slicedToDataFrame | back to summary |
|---|---|
| private boolean slicedToDataFrame | |
| tailBuffers | back to summary |
|---|---|
| private final ArrayDeque<ByteBuffer> tailBuffers | |
| tailSize | back to summary |
|---|---|
| private int tailSize | |
| FramesDecoder | back to summary |
|---|---|
| public FramesDecoder(FramesDecoder. Creates Frame Decoder
| |
| FramesDecoder | back to summary |
|---|---|
| public FramesDecoder(FramesDecoder. Creates Frame Decoder
| |
| close | back to summary |
|---|---|
| public void close(String msg) | |
| decode | back to summary |
|---|---|
| public void decode(ByteBuffer inBoundBuffer) throws IOException Adds the data from the given buffer, and performs frame decoding if possible. Either 1) appends the data from the given buffer to the current buffer ( if there is enough unused space ), or 2) adds it to the next buffer in the queue. If there is enough data to perform frame decoding then, all buffers are decoded and the FrameProcessor is invoked. | |
| frameProcessed | back to summary |
|---|---|
| private void frameProcessed() | |
| getBuffers | back to summary |
|---|---|
| private List | |
| getByte | back to summary |
|---|---|
| public int getByte() | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes(int n) | |
| getInt | back to summary |
|---|---|
| public int getInt() | |
| getShort | back to summary |
|---|---|
| public int getShort() | |
| isUSAscii | back to summary |
|---|---|
| pack-priv static boolean isUSAscii(byte[] bytes) | |
| nextBuffer | back to summary |
|---|---|
| private void nextBuffer() | |
| nextFrame | back to summary |
|---|---|
| private Http2Frame nextFrame() throws IOException | |
| parseAltSvcFrame | back to summary |
|---|---|
| private Http2Frame parseAltSvcFrame(int frameLength, int frameStreamid, int frameFlags) | |
| parseContinuationFrame | back to summary |
|---|---|
| private Http2Frame parseContinuationFrame(int frameLength, int streamid, int flags) | |
| parseDataFrame | back to summary |
|---|---|
| private Http2Frame parseDataFrame(int frameLength, int streamid, int flags) | |
| parseFrameBody | back to summary |
|---|---|
| private Http2Frame parseFrameBody() throws IOException | |
| parseFrameHeader | back to summary |
|---|---|
| private void parseFrameHeader() throws IOException | |
| parseGoAwayFrame | back to summary |
|---|---|
| private Http2Frame parseGoAwayFrame(int frameLength, int streamid, int flags) | |
| parseHeadersFrame | back to summary |
|---|---|
| private Http2Frame parseHeadersFrame(int frameLength, int streamid, int flags) | |
| parsePingFrame | back to summary |
|---|---|
| private Http2Frame parsePingFrame(int frameLength, int streamid, int flags) | |
| parsePriorityFrame | back to summary |
|---|---|
| private Http2Frame parsePriorityFrame(int frameLength, int streamid, int flags) | |
| parsePushPromiseFrame | back to summary |
|---|---|
| private Http2Frame parsePushPromiseFrame(int frameLength, int streamid, int flags) | |
| parseResetFrame | back to summary |
|---|---|
| private Http2Frame parseResetFrame(int frameLength, int streamid, int flags) | |
| parseSettingsFrame | back to summary |
|---|---|
| private Http2Frame parseSettingsFrame(int frameLength, int streamid, int flags) | |
| parseWindowUpdateFrame | back to summary |
|---|---|
| private Http2Frame parseWindowUpdateFrame(int frameLength, int streamid, int flags) | |
| skipBytes | back to summary |
|---|---|
| public void skipBytes(int bytecount) | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| processFrame | back to summary |
|---|---|
| public void processFrame(Http2Frame frame) throws IOException | |