public class CapturingPrintStream
extends java.io.PrintStream
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LIMIT |
| Modifier and Type | Method and Description |
|---|---|
static CapturingPrintStream |
create()
Creates a new CapturingPrintStream with the system's default
charset and Venice's default capturing limit of 10MB.
|
static CapturingPrintStream |
create(int limit)
Creates a new CapturingPrintStream with the system's default
charset and the given capturing limit.
|
static CapturingPrintStream |
create(java.lang.String encoding)
Creates a new CapturingPrintStream with the given encoding
and Venice's default capturing limit of 10MB.
|
static CapturingPrintStream |
create(java.lang.String encoding,
int limit)
Creates a new CapturingPrintStream with the given encoding
and capturing limit.
|
java.lang.String |
getOutput() |
byte[] |
getOutputAsBytes() |
boolean |
isEmpty() |
void |
reset() |
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, writepublic static final int DEFAULT_LIMIT
public static CapturingPrintStream create()
The CapturingPrintStream throws a SecurityException if the bytes written to the stream exceed the specified limit.
public static CapturingPrintStream create(int limit)
The CapturingPrintStream throws a SecurityException if the bytes written to the stream exceed the specified limit.
limit - A capturing limitpublic static CapturingPrintStream create(java.lang.String encoding)
The CapturingPrintStream throws a SecurityException if the bytes written to the stream exceed the specified limit.
encoding - A charset encodingpublic static CapturingPrintStream create(java.lang.String encoding, int limit)
The CapturingPrintStream throws a SecurityException if the bytes written to the stream exceed the specified limit.
encoding - A charset encodinglimit - A capturing limitpublic void reset()
public boolean isEmpty()
public java.lang.String getOutput()
public byte[] getOutputAsBytes()