Class ByteBufferTeePrintStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.eclipse.epsilon.internal.eunit.io.ByteBufferTeePrintStream
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
PrintStream which performs every write twice: once to the original output
stream, and another to an internal byte array, so the full output can be
later collected and processed transparently.
Since
ByteArrayOutputStream.close()
and
OutputStream.flush()
do not do anything, they are not called
from this class.- Version:
- 1.0
- Author:
- Antonio García-Domínguez
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionByteBufferTeePrintStream
(File file) ByteBufferTeePrintStream
(File file, String csn) ByteBufferTeePrintStream
(OutputStream out, boolean autoFlush) ByteBufferTeePrintStream
(OutputStream out, boolean autoFlush, String encoding) ByteBufferTeePrintStream
(String fileName) ByteBufferTeePrintStream
(String fileName, String csn) -
Method Summary
Methods inherited from class java.io.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, writeBytes
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ByteBufferTeePrintStream
-
ByteBufferTeePrintStream
- Throws:
FileNotFoundException
-
ByteBufferTeePrintStream
- Throws:
FileNotFoundException
-
ByteBufferTeePrintStream
-
ByteBufferTeePrintStream
public ByteBufferTeePrintStream(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException -
ByteBufferTeePrintStream
public ByteBufferTeePrintStream(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException -
ByteBufferTeePrintStream
public ByteBufferTeePrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
-
Method Details
-
write
public void write(int b) - Overrides:
write
in classPrintStream
-
write
public void write(byte[] buf, int off, int len) - Overrides:
write
in classPrintStream
-
write
- Overrides:
write
in classPrintStream
- Throws:
IOException
-
getBytes
public byte[] getBytes()Returns the bytes collected by this output stream.
-