org.apache.jena.atlas.io
Class BufferingWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.apache.jena.atlas.io.BufferingWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public final class BufferingWriter
extends Writer

A buffering writer. Like BufferedWriter but with no synchronization. A "synchronized" per character can be expensive.

The standard java.io classes have hidden synchronization so in some very critical situations, this can be expensive.

This class is not thread safe.


Constructor Summary
BufferingWriter(Writer dest)
          Create a buffering writer
BufferingWriter(Writer dest, int size)
          Create a buffering writer
BufferingWriter(Writer dest, int size, int blobSize)
          Create a buffering writer
 
Method Summary
 void close()
           
 void flush()
           
 void output(char ch)
          Output a single character
 void output(char[] chars)
          Output an array of characters
 void output(char[] chars, int start, int length)
          Output an array of characters
 void output(String string)
          Output a string
 void output(String string, int off, int length)
          Output a string
 void write(char[] cbuf)
           
 void write(char[] cbuf, int off, int len)
           
 void write(int ch)
           
 void write(String string)
           
 void write(String string, int off, int len)
           
 
Methods inherited from class java.io.Writer
append, append, append
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferingWriter

public BufferingWriter(Writer dest)
Create a buffering writer


BufferingWriter

public BufferingWriter(Writer dest,
                       int size)
Create a buffering writer


BufferingWriter

public BufferingWriter(Writer dest,
                       int size,
                       int blobSize)
Create a buffering writer

Method Detail

output

public void output(String string)
Output a string

Parameters:
string - Characters

output

public void output(String string,
                   int off,
                   int length)
Output a string

Parameters:
string - Characters
off - Starting point in the string
length - Length

output

public void output(char[] chars)
Output an array of characters


output

public void output(char[] chars,
                   int start,
                   int length)
Output an array of characters

Parameters:
chars - Characters
start - Start
length - Length

output

public void output(char ch)
Output a single character


close

public void close()
Specified by:
close in interface Closeable
Specified by:
close in class Writer

flush

public void flush()
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

write

public void write(char[] cbuf)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(String string,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(String string)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(int ch)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException


Licenced under the Apache License, Version 2.0