GXPARSE hosted by SourceForge.net Logo

ca.gorman.io
Class ParallelWriter

java.lang.Object
  extended by java.io.Writer
      extended by ca.gorman.io.ParallelWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class ParallelWriter
extends Writer

Writer that copies to an array of Writers.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
ParallelWriter(Writer[] writer)
           Construct on an array of destination Writers.
 
Method Summary
 void close()
           Close all Writers.
 void flush()
           Flush all Writers.
 void write(char[] cbuf)
           Copy an array of characters to all Writers.
 void write(char[] cbuf, int off, int len)
           Copy a subarray of characters to all Writers.
 void write(int c)
           Copy a character to all Writers.
 void write(String str)
           Copy a String to all Writers.
 void write(String str, int off, int len)
           Copy a substring to all Writers.
 
Methods inherited from class java.io.Writer
append, append, append
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelWriter

public ParallelWriter(Writer[] writer)

Construct on an array of destination Writers.

Throws:
NullPointerException - when the array or any Writer is null
Method Detail

close

public void close()
           throws IOException

Close all Writers.

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException
See Also:
Writer.close()

flush

public void flush()
           throws IOException

Flush all Writers.

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException
See Also:
Writer.flush()

write

public void write(char[] cbuf)
           throws IOException

Copy an array of characters to all Writers.

Overrides:
write in class Writer
Throws:
IOException
See Also:
Writer.write(char[])

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException

Copy a subarray of characters to all Writers.

Specified by:
write in class Writer
Throws:
IOException
See Also:
Writer.write(char[], int, int)

write

public void write(int c)
           throws IOException

Copy a character to all Writers.

Overrides:
write in class Writer
Throws:
IOException
See Also:
Writer.write(int)

write

public void write(String str)
           throws IOException

Copy a String to all Writers.

Overrides:
write in class Writer
Throws:
IOException
See Also:
Writer.write(String)

write

public void write(String str,
                  int off,
                  int len)
           throws IOException

Copy a substring to all Writers.

Overrides:
write in class Writer
Throws:
IOException
See Also:
Writer.write(String, int, int)

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License