akka.io
Class LengthFieldFrame

java.lang.Object
  extended by akka.io.PipelineStage<Context,Above,Below,Above,Below>
      extended by akka.io.SymmetricPipelineStage<PipelineContext,ByteString,ByteString>
          extended by 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)
           
 
Method Summary
 java.lang.Object apply(PipelineContext ctx)
           
 
Methods inherited from class akka.io.PipelineStage
combine, sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthFieldFrame

public LengthFieldFrame(int maxSize,
                        java.nio.ByteOrder byteOrder,
                        int headerSize,
                        boolean lengthIncludesHeader)
Method Detail

apply

public java.lang.Object apply(PipelineContext ctx)