com.timeindexing.plugin
Class BufferedWriter

java.lang.Object
  extended by com.timeindexing.plugin.BufferedWriter
All Implemented Interfaces:
WriterPlugin

public class BufferedWriter
extends java.lang.Object
implements WriterPlugin

A buffered writer plugin. Takes an IndexItem and writes the bytes to the output stream only when the buffer is full.


Constructor Summary
BufferedWriter()
          Construct a BufferedWriter.
BufferedWriter(int bufSize)
          Construct a BufferedWriter given a buffer size.
BufferedWriter(java.io.OutputStream out, int bufSize)
          Construct a BufferedWriter given an OutputStream and a buffer size.
 
Method Summary
 java.lang.Object begin()
          Called as the first thing.
 java.lang.Object end()
          Called as the last thing.
 long flush()
          Flush out any remainig data.
 java.io.OutputStream getOutputStream()
          Get the OutputStream for the OutputPlugin.
 WriterPlugin setOutputStream(java.io.OutputStream outStream)
          Set the OutputStream for the OutputPlugin.
 long write(IndexItem item, IndexProperties outputProperties)
          Output properties include: "eolmark" -> "newline" ->
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedWriter

public BufferedWriter()
Construct a BufferedWriter. The default buffer size is 8192.


BufferedWriter

public BufferedWriter(int bufSize)
Construct a BufferedWriter given a buffer size.


BufferedWriter

public BufferedWriter(java.io.OutputStream out,
                      int bufSize)
Construct a BufferedWriter given an OutputStream and a buffer size.

Method Detail

write

public long write(IndexItem item,
                  IndexProperties outputProperties)
           throws java.io.IOException
Output properties include:

Specified by:
write in interface WriterPlugin
Throws:
java.io.IOException

flush

public long flush()
           throws java.io.IOException
Flush out any remainig data.

Specified by:
flush in interface WriterPlugin
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
Get the OutputStream for the OutputPlugin.

Specified by:
getOutputStream in interface WriterPlugin

setOutputStream

public WriterPlugin setOutputStream(java.io.OutputStream outStream)
Set the OutputStream for the OutputPlugin.

Specified by:
setOutputStream in interface WriterPlugin

begin

public java.lang.Object begin()
                       throws java.io.IOException
Called as the first thing. Useful for doing any processing before output starts.

Specified by:
begin in interface WriterPlugin
Throws:
java.io.IOException

end

public java.lang.Object end()
                     throws java.io.IOException
Called as the last thing. Useful for doing any processing after output has finished.

Specified by:
end in interface WriterPlugin
Throws:
java.io.IOException


Timeindexing 2008