Package com.sun.mail.util
Class TraceOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.sun.mail.util.TraceOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class TraceOutputStream extends java.io.FilterOutputStreamThis class is a subclass of DataOutputStream that copies the data being written into the DataOutputStream into another output stream. This class is used here to provide a debug trace of the stuff thats being written out into the DataOutputStream.
-
-
Constructor Summary
Constructors Constructor Description TraceOutputStream(java.io.OutputStream out, MailLogger logger)Creates an output stream filter built on top of the specified underlying output stream.TraceOutputStream(java.io.OutputStream out, java.io.OutputStream traceOut)Creates an output stream filter built on top of the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetQuote(boolean quote)Set quote mode.voidsetTrace(boolean trace)Set the trace mode.voidwrite(byte[] b, int off, int len)Writesb.lengthbytes to this output stream.voidwrite(int b)Writes the specifiedbyteto this output stream.
-
-
-
Constructor Detail
-
TraceOutputStream
public TraceOutputStream(java.io.OutputStream out, MailLogger logger)Creates an output stream filter built on top of the specified underlying output stream.- Parameters:
out- the underlying output stream.logger- log trace here
-
TraceOutputStream
public TraceOutputStream(java.io.OutputStream out, java.io.OutputStream traceOut)Creates an output stream filter built on top of the specified underlying output stream.- Parameters:
out- the underlying output stream.traceOut- the trace stream.
-
-
Method Detail
-
setTrace
public void setTrace(boolean trace)
Set the trace mode.- Parameters:
trace- the trace mode
-
setQuote
public void setQuote(boolean quote)
Set quote mode.- Parameters:
quote- the quote mode
-
write
public void write(int b) throws java.io.IOExceptionWrites the specifiedbyteto this output stream. Writes out the byte into the trace stream if the trace mode istrue- Overrides:
writein classjava.io.FilterOutputStream- Parameters:
b- the byte to write- Throws:
java.io.IOException- for I/O errors
-
write
public void write(byte[] b, int off, int len) throws java.io.IOExceptionWritesb.lengthbytes to this output stream. Writes out the bytes into the trace stream if the trace mode istrue- Overrides:
writein classjava.io.FilterOutputStream- Parameters:
b- bytes to writeoff- offset in arraylen- number of bytes to write- Throws:
java.io.IOException- for I/O errors
-
-