mirror of
https://github.com/apple/swift-nio
synced 2026-11-22 04:30:41 +00:00
### Motivation: The current readMultipleIntegers methods are used to consume multiple integer values at once, but lack an equivalent nonmutating API. This can lead to unnecessary complexity when users want to inspect values without advancing readerIndex. THis patch introduces peekMultipleIntegers which uses the current readerIndex, improving safety. This extends previous work on peek methods (issue #2034, issue #2736). ### Modifications: Updated the generation script (.sh file) to produce peekMultipleIntegers variants for each arity of readMultipleIntegers. Added new tests mirroring the existing multi-read/write tests ### Result: Users can now inspect multiple integer values in a ByteBuffer without consuming them, enabling safer workflows. --------- Co-authored-by: Cory Benfield <lukasa@apple.com>