public final class CapturedPrintStream extends PrintStream
PrintStream to capture the output to an in-memory buffer.
The captured stream is available by calling getReader().
UTF-8 is used for encoding and decoding the stream
content.getInstance()out| Modifier and Type | Method and Description |
|---|---|
static CapturedPrintStream |
getInstance()
Instantiates a new
CapturedPrintStream. |
BufferedReader |
getReader()
Gets a
BufferedReader over the bytes written to this PrintStream. |
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, writewritepublic static CapturedPrintStream getInstance()
CapturedPrintStream.CapturedPrintStreampublic BufferedReader getReader()
BufferedReader over the bytes written to this PrintStream.
Bytes copied from the stream to the reader are converted to UTF-8.BufferedReader over the bytes written to this streamCopyright © 2021. All rights reserved.