org.apache.avalon.fortress.tools
Class ChangedFileOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.apache.avalon.fortress.tools.ChangedFileOutputStream

public final class ChangedFileOutputStream
extends java.io.OutputStream

OutputStream which will only update an existing file if its contents actually change. Needed to keep Ant from rebuilding jars even when nothing has changed.

Version:
CVS $Revision: 1.1 $ $Date: 2004/04/02 08:29:44 $
Author:
The Avalon Team

Constructor Summary
ChangedFileOutputStream(java.io.File file)
          Creates a new ChangedFileOutputStream.
 
Method Summary
 void close()
          Close the stream.
 void write(int b)
          Writes the specified byte to this output stream.
 
Methods inherited from class java.io.OutputStream
flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangedFileOutputStream

public ChangedFileOutputStream(java.io.File file)
Creates a new ChangedFileOutputStream.

Parameters:
file - The file to write to.
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this output stream.

Parameters:
b - Byte to write.
Throws:
java.io.IOException - If an I/O error occurs.

close

public void close()
           throws java.io.IOException
Close the stream.

Throws:
java.io.IOException - If an I/O error occurs.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.