1
0
mirror of https://github.com/apple/swift-nio-extras.git synced 2025-06-01 10:36:15 +08:00

3 Commits

Author SHA1 Message Date
Rick Newton-Rogers
54def83a52
update generated test script from swift-nio ()
The newer version of the script automatically calculates accurate
copyright date statements.
2022-12-02 15:17:43 +00:00
David Nadoba
3d14afbe3f
add support for a 24 bit (3 byte) length field ()
Motivation:

The RSocket protocol uses a 24 bit length field

Modifications:

- add two new methods readInteger and writeInteger on ByteBuffer that support reading and writing integers of any size.
- add a new case (.three) to ByteLength

Result:

LengthFieldBasedFrameDecoder & LengthFieldPrepender do now support a 24 bit length field

Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
2021-02-17 09:04:24 +00:00
Liam Flynn
34a17feb83 Adds a LengthFieldPrepender class to prepend the length onto a message. ()
* Adds a LengthFieldPrepender class to prepend the length onto a message.
This class is a type of byte to message encoder.

Motivation:
To encode a prepended length field on data so that messages of arbitrary size can be sent.
Can work as a pair with the ‘LengthFieldBasedFrameDecoder’.

Modifications:
Added ‘LengthFieldPrepender’
Added unit tests for ‘LengthFieldPrepender’ in ‘LengthFieldPrependerTest’
Updated the linux text files by running the script.

Result:
The length can now be easily prepended to any message.
2019-01-02 18:09:05 +00:00