akka.io
Class LengthFieldFrame
java.lang.Object
akka.io.PipelineStage<Context,Above,Below,Above,Below>
akka.io.SymmetricPipelineStage<PipelineContext,ByteString,ByteString>
akka.io.LengthFieldFrame
public class LengthFieldFrame
- extends SymmetricPipelineStage<PipelineContext,ByteString,ByteString>
Pipeline stage for length-field encoded framing. It will prepend a
four-byte length header to the message; the header contains the length of
the resulting frame including header in big-endian representation.
The maxSize
argument is used to protect the communication channel sanity:
larger frames will not be sent (silently dropped) or received (in which case
stream decoding would be broken, hence throwing an IllegalArgumentException).
Constructor Summary |
LengthFieldFrame(int maxSize,
java.nio.ByteOrder byteOrder,
int headerSize,
boolean lengthIncludesHeader)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthFieldFrame
public LengthFieldFrame(int maxSize,
java.nio.ByteOrder byteOrder,
int headerSize,
boolean lengthIncludesHeader)
apply
public java.lang.Object apply(PipelineContext ctx)