Class FramesDecoder
- java.lang.Object
-
- jdk.incubator.http.internal.frame.FramesDecoder
-
public class FramesDecoder extends java.lang.Object
Frames Decodercollect 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FramesDecoder.FrameProcessor
-
Constructor Summary
Constructors Constructor Description FramesDecoder(FramesDecoder.FrameProcessor frameProcessor)
Creates Frame DecoderFramesDecoder(FramesDecoder.FrameProcessor frameProcessor, int maxFrameSize)
Creates Frame Decoder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decode(ByteBufferReference buffer)
put next buffer into queue, if frame decoding is possible - decode all buffers and invoke FrameProcessorint
getByte()
byte[]
getBytes(int n)
int
getInt()
int
getShort()
void
skipBytes(int bytecount)
-
-
-
Constructor Detail
-
FramesDecoder
public FramesDecoder(FramesDecoder.FrameProcessor frameProcessor)
Creates Frame Decoder- Parameters:
frameProcessor
- - callback for decoded frames
-
FramesDecoder
public FramesDecoder(FramesDecoder.FrameProcessor frameProcessor, int maxFrameSize)
Creates Frame Decoder- Parameters:
frameProcessor
- - callback for decoded framesmaxFrameSize
- - maxFrameSize accepted by this decoder
-
-
Method Detail
-
decode
public void decode(ByteBufferReference buffer) throws java.io.IOException
put next buffer into queue, if frame decoding is possible - decode all buffers and invoke FrameProcessor- Parameters:
buffer
-- Throws:
java.io.IOException
-
getByte
public int getByte()
-
getShort
public int getShort()
-
getInt
public int getInt()
-
getBytes
public byte[] getBytes(int n)
-
skipBytes
public void skipBytes(int bytecount)
-
-