public class OutputPipe extends OutputStream
Modifier and Type | Field and Description |
---|---|
protected boolean |
append |
protected boolean |
buffer |
protected BufferedWriter |
bw |
protected boolean |
error |
protected File |
fout |
protected boolean |
log |
protected static org.slf4j.Logger |
logger |
protected String |
reply |
protected StringBuffer |
sb |
Constructor and Description |
---|
OutputPipe() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Nulls out the buffer.
|
void |
flush()
If log is true, logs the current buffer as info; if file exists, writes
it to file and flushes.
|
String |
readReply()
Sets reply to empty after read.
|
void |
setAppend(boolean b) |
void |
setBuffer(boolean b) |
void |
setError(boolean b) |
void |
setFile(File f) |
void |
setLog(boolean b) |
void |
write(int bigbyte)
Appends to string buffer.
|
write, write
protected static org.slf4j.Logger logger
protected StringBuffer sb
protected String reply
protected File fout
protected boolean log
protected boolean buffer
protected boolean append
protected boolean error
protected BufferedWriter bw
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public String readReply()
public void setAppend(boolean b)
b
- if true, append to the indicated file (default=false).public void setBuffer(boolean b)
b
- if true, stores received output in a buffer to be read
(default=true).public void setError(boolean b)
b
- if true, this stream represents an error stream.public void setFile(File f)
f
- file to which to write output.public void setLog(boolean b)
b
- if true, log message as INFO or ERROR (if an error stream).public void write(int bigbyte) throws IOException
write
in class OutputStream
bigbyte
- int representation of a byte to write.IOException
- if output exceeds memory, or if the stream has been closed.Copyright © 2018. All rights reserved.