TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.io
Class DecoratingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.schlichtherle.truezip.io.DecoratingOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
ConcurrentOutputShop.ConcurrentOutputStream, FsMultiplexedArchiveOutputShop.EntryOutputStream, FsMultiplexedArchiveOutputShop.TempEntryOutputStream, FsStatistics.CountingOutputStream, IOCache.Buffer.BufferOutputStream, LazyOutputSocket.ProxyOutputStream, LEDataOutputStream, SynchronizedOutputStream

public abstract class DecoratingOutputStream
extends OutputStream

An abstract decorator for an output stream. This is a clean room implementation of its cousin FilterOutputStream in the JSE, but optimized for performance and without multithreading support.

Author:
Christian Schlichtherle
See Also:
DecoratingInputStream

Field Summary
protected  OutputStream delegate
          The nullable decorated output stream.
 
Constructor Summary
protected DecoratingOutputStream(OutputStream out)
          Constructs a new synchronized output stream.
 
Method Summary
 void close()
           
 void flush()
           
 String toString()
          Returns a string representation of this object for debugging and logging purposes.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

@Nullable
protected OutputStream delegate
The nullable decorated output stream.

Constructor Detail

DecoratingOutputStream

protected DecoratingOutputStream(OutputStream out)
Constructs a new synchronized output stream. This object will synchronize on itself.

Parameters:
out - the output stream to wrap in this decorator.
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public final void write(byte[] b)
                 throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

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

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

toString

public String toString()
Returns a string representation of this object for debugging and logging purposes.

Overrides:
toString in class Object

TrueZIP Kernel 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.