org.apache.avalon.fortress.tools
Class ChangedFileOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.avalon.fortress.tools.ChangedFileOutputStream
All Implemented Interfaces:
Closeable, Flushable

public final class ChangedFileOutputStream
extends 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(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(File file)
Creates a new ChangedFileOutputStream.

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

write

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

Specified by:
write in class OutputStream
Parameters:
b - Byte to write.
Throws:
IOException - If an I/O error occurs.

close

public void close()
           throws IOException
Close the stream.

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException - If an I/O error occurs.


Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.