org.acm.seguin.io
Class InplaceOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.acm.seguin.io.InplaceOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class InplaceOutputStream
extends java.io.OutputStream

To the user of this object, it appears that the file is written in place.

Version:
$Id: InplaceOutputStream.java,v 1.6 2003/09/01 00:25:31 mikeatkinson Exp $
Author:
Chris Seguin, Mike Atkinson

Constructor Summary
InplaceOutputStream(java.io.File dest)
          Creates an InplaceOutputStream
 
Method Summary
 void close()
          Closes the file
protected  void finalize()
          Make sure to clean up after itself
 void flush()
          Flush the file
 void write(byte[] b)
          Write a byte array to the file
 void write(byte[] b, int off, int len)
          Write a byte array to the file
 void write(int b)
          Write a byte to the file
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InplaceOutputStream

public InplaceOutputStream(java.io.File dest)
                    throws java.io.IOException
Creates an InplaceOutputStream

Parameters:
dest - the output file location
Throws:
java.io.IOException - throws an IOException
Method Detail

close

public void close()
           throws java.io.IOException
Closes the file

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException - throws an IOException

flush

public void flush()
           throws java.io.IOException
Flush the file

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException - throws an IOException

write

public void write(int b)
           throws java.io.IOException
Write a byte to the file

Specified by:
write in class java.io.OutputStream
Parameters:
b - the byte to be written
Throws:
java.io.IOException - throws an IOException

write

public void write(byte[] b)
           throws java.io.IOException
Write a byte array to the file

Overrides:
write in class java.io.OutputStream
Parameters:
b - the byte array to be written
Throws:
java.io.IOException - throws an IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Write a byte array to the file

Overrides:
write in class java.io.OutputStream
Parameters:
b - the byte array to be written
off - the offset into the array
len - the number of bytes to write
Throws:
java.io.IOException - throws an IOException

finalize

protected void finalize()
Make sure to clean up after itself

Overrides:
finalize in class java.lang.Object