Forcing bytes downward in Okio

1 · Jake Wharton · Sept. 6, 2016, midnight
Okio’s BufferedSink is a high-level abstraction for writing binary and character data as bytes. Its design stems from frustrations with the JDK’s java.io.* and java.nio.* libraries. At Droidcon Montreal last year I gave a presentation comparing it with the former, but also showcased Okio’s concept of a segment and how it enables the library to cheaply move bytes. If you aren’t familiar with Okio I encourage you to go watch the presentation first since the rest of this post will assume at least c...