Skip to content

Instantly share code, notes, and snippets.

@sadache
Created August 10, 2012 18:09
Show Gist options
  • Save sadache/3316242 to your computer and use it in GitHub Desktop.
Save sadache/3316242 to your computer and use it in GitHub Desktop.
Http Chunked protocole implemented on top of Play's API
Enumeratee.map[Array[Byte]]{ e =>
val length = e.size
val CRLF = "\r\n".getBytes("UTF-8")
(length.toHexString.getBytes ++ CRLF ++ e ++ CRLF):Array[Byte]
} ><>
Enumeratee.trailing(Seq((0.toHexString.getBytes) ++ (CRLF ++ CRLF)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment