4 Commits
Author SHA1 Message Date
Francesco Paolo Severino 32f395bc91 Add helpers for reading length-prefixed things (#3589)
Add missing helpers for reading length-prefixed strings and bytes with
customizable encodings for the length.

### Motivation:

There are already some APIs for writing length-prefixed strings and
bytes with a custom strategy for encoding the length, but there weren't
helpers to read them.

### Modifications:

- Add missing helpers for reading length-prefixed strings and bytes with
customizable encodings for the length
- Add tests for the new APIs 
- Fix DocC comments and improve the related article 

### Result:

New APIs are added for reading length-prefixed strings and bytes with a
custom strategy for encoding the length.
2026-05-12 11:53:10 +01:00
Cory Benfield fd7c6af4f0 Replace rethrows with typed throws in ByteBuffer (#3372)
Motivation:

Users who want to use typed throws would benefit from us propagating the
thrown error type through our APIs. Most of our surface doesn't allow
for that because it relies on standard library APIs that haven't been
updated, but we can do it for ByteBuffer which is entirely ours.

Modifications:

- Adopt typed rethrows in ByteBuffer

Result:

Users have an easier time working with ByteBuffer
2025-11-05 16:14:30 -05:00
Rick Newton-Rogers adfd61adc5 Use Swift 6.0 docs pipeline (#2966)
### Motivation:

Documentation checking catches more issues in Swift 6.0.

### Modifications:

Adopt the Swift 6.0 image and fix the errors.

### Result:

More accurate docs.
2024-11-07 13:03:47 +00:00
hamzahrmalik fb87d5e49e Add functions for reading and writing length-prefixed data with customizable encodings for the length (#2867)
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
2024-10-02 09:54:42 +00:00