org.egothor.dockyard
Class StreamWriter

java.lang.Object
  extended by org.egothor.dockyard.StreamWriter
All Implemented Interfaces:
BarrelWriter

public class StreamWriter
extends java.lang.Object
implements BarrelWriter

StreamWriter.java

Author:
galambos

Constructor Summary
StreamWriter(DataOutput out)
          Writer to a file.
 
Method Summary
 void append(BarrelReader br)
          Append the given Barrel to this BarrelWriter's Barrel.
 void close()
          Finish all operations so that the Barrel produced is consistent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamWriter

public StreamWriter(DataOutput out)
Writer to a file. Be aware, that the stream is closed by @link{#close} method iff the output stream is instance of @link{org.egothor.io.DataOutputStream}.

Parameters:
out - output stream
Method Detail

append

public void append(BarrelReader br)
            throws java.io.IOException
Description copied from interface: BarrelWriter
Append the given Barrel to this BarrelWriter's Barrel. The incoming Barrel (represented by its BarrelReader) is optimized during the append operation. Documents get new unique IDs, and inverted lists are stored without removed documents.

Specified by:
append in interface BarrelWriter
Parameters:
br - the Barrel to append
Throws:
java.io.IOException - if an I/O error occurs

close

public void close()
Description copied from interface: BarrelWriter
Finish all operations so that the Barrel produced is consistent. It also closes all open files.

Specified by:
close in interface BarrelWriter