Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created November 1, 2012 14:30
Show Gist options
  • Save joshcough/3993962 to your computer and use it in GitHub Desktop.
Save joshcough/3993962 to your computer and use it in GitHub Desktop.
val utf8 = Write.utf8
def stringF(s: Source): String = {
val n = Read.intF(s)
val buf = s.readBytes(n)
val cbuf = utf8.decode(java.nio.ByteBuffer.wrap(buf)).array
new String(cbuf)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment