mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: Sometimes it would be handy to have ByteBuffers conform to a `Collection` where `Element == UInt8`. ByteBuffer however has multiple modes how to operate so it would be wrong to have say the readable bytes be the ByteBuffer's collection. Therefore it would be nice to have a view into a `ByteBuffer` which is a `Collection where Element == UInt8`. This introduces these. Modifications: - add `ByteBufferView` - add `ByteBuffer.readableBytesView` - add `ByteBuffer.viewBytes(range: ...)` Result: - easier to work with `ByteBuffer`s in the Swift ecosystem.