akka.stream.io

Framing

object Framing

Source
Framing.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Framing
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class FramingException extends RuntimeException

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def delimiter(delimiter: ByteString, maximumFrameLength: Int, allowTruncation: Boolean = false): Flow[ByteString, ByteString, Unit]

    Creates a Flow that handles decoding a stream of unstructured byte chunks into a stream of frames where the incoming chunk stream uses a specific byte-sequence to mark frame boundaries.

    Creates a Flow that handles decoding a stream of unstructured byte chunks into a stream of frames where the incoming chunk stream uses a specific byte-sequence to mark frame boundaries.

    The decoded frames will include the separator sequence. If this is not desired, this Flow can be augmented with a simple map operation that removes this separator.

    If there are buffered bytes (an incomplete frame) when the input stream finishes and allowTruncation is set to false then this Flow will fail the stream reporting a truncated frame.

    delimiter

    The byte sequence to be treated as the end of the frame.

    maximumFrameLength

    The maximum length of allowed frames while decoding. If the maximum length is exceeded this Flow will fail the stream.

    allowTruncation

    If turned on, then when the last frame being decoded contains no valid delimiter this Flow fails the stream instead of returning a truncated frame.

    returns

  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def lengthField(fieldLength: Int, fieldOffset: Int = 0, maximumFrameLength: Int, byteOrder: ByteOrder = ByteOrder.LITTLE_ENDIAN): Flow[ByteString, ByteString, Unit]

    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.

    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.

    fieldLength

    The length of the "size" field in bytes

    fieldOffset

    The offset of the field from the beginning of the frame in bytes

    maximumFrameLength

    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)

    byteOrder

    The ByteOrder to be used when decoding the field

    returns

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. def simpleFramingProtocol(maximumMessageLength: Int): BidiFlow[ByteString, ByteString, ByteString, ByteString, Unit]

    Returns a BidiFlow that implements a simple framing protocol.

    Returns a BidiFlow that implements a simple framing protocol. This is a convenience wrapper over Framing#lengthField and simply attaches a length field header of four bytes (using big endian encoding) to outgoing messages, and decodes such messages in the inbound direction. The decoded messages do not contain the header.

    This BidiFlow is useful if a simple message framing protocol is needed (for example when TCP is used to send individual messages) but no compatibility with existing protocols is necessary.

    The encoded frames have the layout

    [4 bytes length field, Big Endian][User Payload]

    The length field encodes the length of the user payload excluding the header itself.

    maximumMessageLength

    Maximum length of allowed messages. If sent or received messages exceed the configured limit this BidiFlow will fail the stream. The header attached by this BidiFlow are not included in this limit.

    returns

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped