public class LogOutputStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
buf |
private int |
lastb |
protected java.util.logging.Level |
level |
protected MailLogger |
logger |
private int |
pos |
Constructor and Description |
---|
LogOutputStream(MailLogger logger)
Log to the specified logger.
|
Modifier and Type | Method and Description |
---|---|
private void |
expandCapacity(int len)
Ensure that the buffer can hold at least len bytes
beyond the current position.
|
protected void |
log(java.lang.String msg)
Log the specified message.
|
private void |
logBuf()
Convert the buffer to a string and log it.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected MailLogger logger
protected java.util.logging.Level level
private int lastb
private byte[] buf
private int pos
public LogOutputStream(MailLogger logger)
logger
- the MailLoggerpublic void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
protected void log(java.lang.String msg)
msg
- the message to logprivate void logBuf()
private void expandCapacity(int len)