Java: PrintStream to String?

前端 未结 6 908
半阙折子戏
半阙折子戏 2021-01-30 15:10

I have a function that takes an object of a certain type, and a PrintStream to which to print, and outputs a representation of that object. How can I capture this f

6条回答
  •  迷失自我
    2021-01-30 16:11

    Maybe this question might help you: Get an OutputStream into a String

    Subclass OutputStream and wrap it in PrintStream

提交回复
热议问题