| |
|
| java.lang.Object java.io.OutputStream org.continuent.sequoia.common.util.LoggingOutputStream
LoggingOutputStream | public class LoggingOutputStream extends OutputStream (Code) | | An OutputStream that flushes out to a Category.
Note that no data is written out to the Category until the stream is flushed
or closed.
author: Jim Moore author: Nicolas Modrzyk See Also: Category |
Constructor Summary | |
public | LoggingOutputStream(Category cat, Priority priority) Creates the LoggingOutputStream to flush to the given Category. |
Method Summary | |
public void | close() Closes this output stream and releases any system resources associated
with this stream. | public void | flush() Flushes this output stream and forces any buffered output bytes to be
written out. | public void | write(int b) Writes the specified byte to this output stream. |
DEFAULT_BUFFER_LENGTH | final public static int DEFAULT_BUFFER_LENGTH(Code) | | The default number of bytes in the buffer. =2048
|
LINE_SEPARATOR | final protected static String LINE_SEPARATOR(Code) | | |
buf | protected byte[] buf(Code) | | The internal buffer where data is stored.
|
category | protected Category category(Code) | | The category to write to.
|
count | protected int count(Code) | | The number of valid bytes in the buffer. This value is always in the range
0 through buf.length; elements buf[0]
through buf[count-1] contain valid byte data.
|
priority | protected Priority priority(Code) | | The priority to use when writing to the Category.
|
LoggingOutputStream | public LoggingOutputStream(Category cat, Priority priority) throws IllegalArgumentException(Code) | | Creates the LoggingOutputStream to flush to the given Category.
Parameters: cat - the Category to write to Parameters: priority - the Priority to use when writing to the Category exception: IllegalArgumentException - if cat == null or priority == null |
close | public void close()(Code) | | Closes this output stream and releases any system resources associated
with this stream. The general contract of close is that it
closes the output stream. A closed stream cannot perform output operations
and cannot be reopened.
|
flush | public void flush()(Code) | | Flushes this output stream and forces any buffered output bytes to be
written out. The general contract of flush is that calling
it is an indication that, if any bytes previously written have been
buffered by the implementation of the output stream, such bytes should
immediately be written to their intended destination.
|
write | public void write(int b) throws IOException(Code) | | Writes the specified byte to this output stream. The general contract for
write is that one byte is written to the output stream. The
byte to be written is the eight low-order bits of the argument b .
The 24 high-order bits of b are ignored.
Parameters: b - the byte to write exception: IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed. |
|
|
|