playframework/playframework — pull request #2036 by kruckenb (2013-11-14 16:35:43+00:00)
Title: avoid array copy unless necessary, to improve performance

When `read == chunkSize` (which should be the case until the end of the file), there's no need to allocate and copy into another bytearray, we can just return `buffer`. Should improve performance of fromStream().