org.archive.io
Class DiskByteQueue.FlipFileOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.archive.io.DiskByteQueue.FlipFileOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
DiskByteQueue

 class DiskByteQueue.FlipFileOutputStream
extends java.io.OutputStream

An output stream that supports the DiskBackedByteQueue, by always appending to the current outFile.

Author:
Gordon Mohr.

Field Summary
(package private)  java.io.FileOutputStream fileStream
           
(package private)  java.io.BufferedOutputStream outStream
           
 
Constructor Summary
DiskByteQueue.FlipFileOutputStream()
          Constructor
 
Method Summary
 void close()
          (non-Javadoc)
 void flush()
          (non-Javadoc)
protected  void setupStreams()
           
 void write(byte[] b)
          (non-Javadoc)
 void write(byte[] b, int off, int len)
          (non-Javadoc)
 void write(int b)
          (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outStream

java.io.BufferedOutputStream outStream

fileStream

java.io.FileOutputStream fileStream
Constructor Detail

DiskByteQueue.FlipFileOutputStream

public DiskByteQueue.FlipFileOutputStream()
                                   throws java.io.FileNotFoundException
Constructor

Throws:
java.io.FileNotFoundException - if unable to create FileOutStream.
Method Detail

setupStreams

protected void setupStreams()
                     throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

write

public void write(int b)
           throws java.io.IOException
(non-Javadoc)

Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException
See Also:
OutputStream.write(int)

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
(non-Javadoc)

Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException
See Also:
OutputStream.write(byte[], int, int)

write

public void write(byte[] b)
           throws java.io.IOException
(non-Javadoc)

Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException
See Also:
OutputStream.write(byte[])

close

public void close()
           throws java.io.IOException
(non-Javadoc)

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException
See Also:
OutputStream.close()

flush

public void flush()
           throws java.io.IOException
(non-Javadoc)

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException
See Also:
OutputStream.flush()


Copyright © 2003-2005 Internet Archive. All Rights Reserved.