mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Add functions for reading and writing length-prefixed data with customizable encodings for the length, particularly for quic variable-length integers (RFC 9000) ### Motivation: Many protocols require us to write data and then prefix that data with its length. But each protocol has a different way of encoding the length. This PR introduces general purpose functions which can be extended for different encoding strategies ### Modifications: Create a new protocol which defines how to encode an integer Implement this protocol for QUIC Provide functions on bytebuffer for writing length-prefixed buffers, strings or bytes