Convert InputStream to byte array in Java

前端 未结 30 3492
無奈伤痛
無奈伤痛 2020-11-21 12:08

How do I read an entire InputStream into a byte array?

30条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-21 12:59

    As always, also Spring framework (spring-core since 3.2.2) has something for you: StreamUtils.copyToByteArray()

提交回复
热议问题