BufferedOutputStream vs ByteArrayOutputStream

后端 未结 3 1657
你的背包
你的背包 2021-02-07 02:15

Is there any advantage in wrapping a BufferedOutputStream around a ByteArrayOutputStream instead of just using the ByteArrrayOutputStream by itself?

3条回答
  •  青春惊慌失措
    2021-02-07 02:31

    ByteArrayOutputStream is not recommended if you want to get high performance, but one interesting feature is to send a message with unknown length. For a better comprehension about how these two methods work, see http://java-performance.info/java-io-bytearrayoutputstream/.

提交回复
热议问题