public class TeeOutputStream extends FilterOutputStream
PrintWriter r = new PrintWriter(new TeeOutputStream(new FileOutputStream("file"), new File("otherfile")));
Constructor and Description |
---|
TeeOutputStream(OutputStream os,
File f)
Create a new TeeOutputStream on the given OutputStream
and copy the stream to the given File.
|
TeeOutputStream(OutputStream os,
File f,
boolean append)
Create a new TeeOutputStream on the given OutputStream
and copy the stream to the given File.
|
TeeOutputStream(OutputStream os,
OutputStream tos)
Create a new TeeOutputStream on the given OutputStream
and copy the stream to the other OuputStream.
|
TeeOutputStream(OutputStream os,
String f)
Create a new TeeOutputStream on the given OutputStream
and copy the stream to the given File.
|
TeeOutputStream(OutputStream os,
String f,
boolean append)
Create a new TeeOutputStream on the given OutputStream
and copy the stream to the given File.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finalize() |
void |
flush() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public TeeOutputStream(OutputStream os, OutputStream tos) throws IOException
os
- Writes to this OutputStreamtos
- Write to this OutputStreamIOException
public TeeOutputStream(OutputStream os, File f, boolean append) throws IOException
os
- Writes to this OutputStreamf
- Write to this Fileappend
- Append to file not overwriteIOException
public TeeOutputStream(OutputStream os, File f) throws IOException
os
- Writes to this OutputStreamf
- Write to this FileIOException
public TeeOutputStream(OutputStream os, String f, boolean append) throws IOException
os
- Writes to this OutputStreamf
- Write to this Fileappend
- Append to file not overwriteIOException
public TeeOutputStream(OutputStream os, String f) throws IOException
os
- Writes to this OutputStreamf
- Write to this FileIOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
public void write(int b) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] b) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
IOException