inline fun <T> ByteString.parse(block: (BufferedSource) -> T): T(source) Runs block
with a BufferedSource
that will read from this ByteString
.
Lets you do stuff like:
myBlob.parse {
MyValueObject(
name = it.readUtf8WithLength(),
age = it.readInt()
)
}