Package io.activej.csp.process.frames
Interface BlockEncoder
public interface BlockEncoder
Defines methods to encode incoming data into Data Blocks
-
Method Summary
Modifier and TypeMethodDescriptionio.activej.bytebuf.ByteBufencode(io.activej.bytebuf.ByteBuf inputBuf) Encodes inputByteBufas a Data Block.io.activej.bytebuf.ByteBufEncodes an End-Of-Stream Block which indicates an end of stream.voidreset()Attempts to reset some internal state of encoder.
-
Method Details
-
encode
io.activej.bytebuf.ByteBuf encode(io.activej.bytebuf.ByteBuf inputBuf) Encodes inputByteBufas a Data Block. Input bufs are not empty. If it is the first bytebuf, encoder may encode Stream Header together with Data Block.- Parameters:
inputBuf- buf to be encoded- Returns:
ByteBufthat contains encoded data
-
reset
void reset()Attempts to reset some internal state of encoder. This method is called before each call toencode(ByteBuf)(ifChannelFrameEncoderis configured to do so). -
encodeEndOfStreamBlock
io.activej.bytebuf.ByteBuf encodeEndOfStreamBlock()Encodes an End-Of-Stream Block which indicates an end of stream.- Returns:
ByteBufwhich contains End-Of-Stream block
-