org.basex.io.out
Class BufferOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by org.basex.io.out.BufferOutput
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class BufferOutput
extends java.io.OutputStream

This class uses a byte buffer to speed up output stream processing.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen, Tim Petrowsky

Constructor Summary
BufferOutput(java.io.OutputStream out)
          Constructor with a default buffer size.
BufferOutput(java.io.OutputStream out, int bufs)
          Constructor with a specific buffer size.
BufferOutput(java.lang.String file)
          Constructor.
 
Method Summary
 void close()
           
 void flush()
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferOutput

public BufferOutput(java.lang.String file)
             throws java.io.IOException
Constructor.

Parameters:
file - target file
Throws:
java.io.IOException - I/O exception

BufferOutput

public BufferOutput(java.io.OutputStream out)
Constructor with a default buffer size.

Parameters:
out - the stream to write to

BufferOutput

public BufferOutput(java.io.OutputStream out,
                    int bufs)
Constructor with a specific buffer size.

Parameters:
out - the stream to write to
bufs - buffer size
Method Detail

write

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

flush

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

close

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