Open
Description
Okio was written in Java before being ported to Kotlin, and binary compatibility meant we retained the use of signed numbers. With this library being a fresh take on its design, there is an opportunity to switch to unsigned numbers where it makes sense (and if it makes sense).
It certainly would be nice to never have to check values for being negative all over the place in the internals.
The concern, of course, is that there is enough overhead to make this not worthwhile. Or that the conversion ceremony is too much boilerplate.
I suspect the unsafe internals and unsafe APIs will still likely use signed ByteArray
and signed Int
s, but perhaps the size and indexing of Buffer
/ByteString
and all their APIs could switch.