When designing APIs that deal with byte-level data, is there a good reason to use Data as a buffer instead of [UInt8]?
From what I understand, Arrays of trivial types like UInt8 are always stored contiguously in memory. But I also know even SwiftNIO uses its own ByteBuffer type instead of [UInt8]. What do these buffer types do differently, and am I giving up on valuable performance or safety by simply using [UInt8]?
3
0
2.9k