Click or drag to resize
Akka.NETFramingLengthField Method
Creates a Flow that decodes an incoming stream of unstructured byte chunks into a stream of frames, assuming that incoming frames have a field that encodes their length. If the input stream finishes before the last frame has been fully decoded this Flow will fail the stream reporting a truncated frame.

Namespace:  Akka.Streams.Dsl
Assembly:  Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax
public static Flow<ByteString, ByteString, NotUsed> LengthField(
	int fieldLength,
	int maximumFramelength,
	int fieldOffset = 0,
	ByteOrder byteOrder = ByteOrder.LittleEndian
)

Parameters

fieldLength
Type: SystemInt32
The length of the "Count" field in bytes
maximumFramelength
Type: SystemInt32
The maximum length of allowed frames while decoding. If the maximum length is exceeded this Flow will fail the stream. This length *includes* the header (i.e the offset and the length of the size field)
fieldOffset (Optional)
Type: SystemInt32
The offset of the field from the beginning of the frame in bytes
byteOrder (Optional)
Type: Akka.IOByteOrder
The ByteOrder to be used when decoding the field

Return Value

Type: FlowByteString, ByteString, NotUsed
TBD
Exceptions
ExceptionCondition
ArgumentException This exception is thrown when the specified fieldLength is not equal to either 1, 2, 3 or 4.
See Also