How do I read an entire InputStream into a byte array?
InputStream
As always, also Spring framework (spring-core since 3.2.2) has something for you: StreamUtils.copyToByteArray()
StreamUtils.copyToByteArray()