org.netbeans.lib.cvsclient.util
Class LoggedDataOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.netbeans.lib.cvsclient.util.LoggedDataOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class LoggedDataOutputStream
extends java.io.FilterOutputStream

A data output stream that also logs everything sent to a Writer (via the logger).


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
LoggedDataOutputStream(java.io.OutputStream out)
          Construct a logged stream using the specified underlying stream
 
Method Summary
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 long getCounter()
           
 java.io.OutputStream getUnderlyingStream()
           
 void setUnderlyingStream(java.io.OutputStream os)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeBytes(java.lang.String line)
          Write a line to the stream, logging it too.
 void writeBytes(java.lang.String line, java.lang.String encoding)
          Write a line to the stream, logging it too.
 void writeChars(java.lang.String line)
          Deprecated. Line to to bytes conversion is host specifics. Use raw byte access methods insted.
 
Methods inherited from class java.io.FilterOutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggedDataOutputStream

public LoggedDataOutputStream(java.io.OutputStream out)
Construct a logged stream using the specified underlying stream

Parameters:
out - the stream
Method Detail

writeChars

public void writeChars(java.lang.String line)
                throws java.io.IOException
Deprecated. Line to to bytes conversion is host specifics. Use raw byte access methods insted.

Write a line to the stream, logging it too. For compatibility reasons only. Does exactly the same what writeBytes() does.

Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String line)
                throws java.io.IOException
Write a line to the stream, logging it too. Line to to bytes conversion is host specifics. Use writeBytes(String, String) if possible.

Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String line,
                       java.lang.String encoding)
                throws java.io.IOException
Write a line to the stream, logging it too.

Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException

getUnderlyingStream

public java.io.OutputStream getUnderlyingStream()

setUnderlyingStream

public void setUnderlyingStream(java.io.OutputStream os)

getCounter

public long getCounter()

 

Built on August 7 2008.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.