Multiple readers for InputStream in Java

前端 未结 7 982
名媛妹妹
名媛妹妹 2020-12-03 11:28

I have an InputStream from which I\'m reading characters. I would like multiple readers to access this InputStream. It seems that a reasonable way to achieve this is to writ

7条回答
  •  猫巷女王i
    2020-12-03 11:56

    Use TeeInputStream to copy all the bytes read from InputStream to secondary OutputStream, e.g. ByteArrayOutputStream.

提交回复
热议问题