Convert Contents Of A ByteArrayInputStream To String

后端 未结 5 1029
盖世英雄少女心
盖世英雄少女心 2020-12-30 23:11

I read this post but I am not following. I have seen this but have not seen a proper example of converting a ByteArrayInputStream to String using

5条回答
  •  一向
    一向 (楼主)
    2020-12-30 23:37

    Java 9+ solution:

    new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
    

提交回复
热议问题