Package sk.antons.web.filter.util
Class OutputStreamTee
- java.lang.Object
-
- java.io.OutputStream
-
- sk.antons.web.filter.util.OutputStreamTee
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class OutputStreamTee extends OutputStream
Helper class for wrapping OutputStream instances. It enable to read previously written content.- Author:
- antons
-
-
Constructor Summary
Constructors Constructor Description OutputStreamTee(OutputStream os)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()static OutputStreamTeeinstance(OutputStream os)static OutputStreamnullOutputStream()byte[]toByteArray()InputStreamtoInputStream()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Constructor Detail
-
OutputStreamTee
public OutputStreamTee(OutputStream os)
-
-
Method Detail
-
instance
public static OutputStreamTee instance(OutputStream os)
-
nullOutputStream
public static OutputStream nullOutputStream()
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
toByteArray
public byte[] toByteArray()
-
toInputStream
public InputStream toInputStream()
-
-