def chunkedContentLength(chunkedResult: ChunkedResult[Array[Byte]]): Int = {
var numBytes = 0
val countIteratee = Iteratee.fold[Array[Byte], Unit](0) { (_, bytes) => numBytes += bytes.size }
val promisedIteratee = chunkedResult.chunks(countIteratee).asInstanceOf[Promise[Iteratee[Array[Byte], Unit]]]
promisedIteratee.await(5000).get.run.await(5000).get // waits until all the chunks have been retrieved
numBytes
}
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/AxfPrhLVicQJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.