Write string to output stream

后端 未结 6 874
误落风尘
误落风尘 2020-12-04 07:34

I have several output listeners that are implementing OutputStream. It can be either a PrintStream writing to stdout or to a File, or it can be writing to memory or any othe

6条回答
  •  难免孤独
    2020-12-04 08:23

    Wrap your OutputStream with a PrintWriter and use the print methods on that class. They take in a String and do the work for you.

提交回复
热议问题