Convert OutputStream to ByteArrayOutputStream

后端 未结 3 1081
青春惊慌失措
青春惊慌失措 2021-02-18 23:59

I am trying to convert an OutputStream to a ByteArrayOutput Stream. I was unable to find any clear simple answers on how to do this. This question wa

3条回答
  •  醉酒成梦
    2021-02-19 00:14

    You can use toByteArray function on the output stream you have.That's is let say you have outputStream buffer So you can do buffer.toByteArray .

    For more you can look at the answer of Convert InputStream to byte array in Java .

提交回复
热议问题