javatools.filehandlers
Class UTF8Writer

java.lang.Object
  extended by java.io.Writer
      extended by javatools.filehandlers.UTF8Writer
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class UTF8Writer
extends java.io.Writer

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This allows to write characters as UTF8 to a file
Example:

     Writer w=new UTF8Writer("c:\\blah.blb");
     w.write(Char.decodePercentage("Hallöchen"));
     w.close();


Constructor Summary
UTF8Writer()
          Writes nowhere
UTF8Writer(java.io.File f)
          Writes to a file
UTF8Writer(java.io.File f, boolean append)
          Writes to a file
UTF8Writer(java.io.OutputStream f)
          Writes to a writer
UTF8Writer(java.lang.String f)
          Writes to a file
 
Method Summary
 void close()
           
 void flush()
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(java.lang.String s)
          Writes a string
 void writeln(java.lang.String s)
          Writes a line
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTF8Writer

public UTF8Writer(java.io.File f,
                  boolean append)
           throws java.io.IOException
Writes to a file

Throws:
java.io.IOException

UTF8Writer

public UTF8Writer(java.io.File f)
           throws java.io.IOException
Writes to a file

Throws:
java.io.IOException

UTF8Writer

public UTF8Writer()
Writes nowhere


UTF8Writer

public UTF8Writer(java.lang.String f)
           throws java.io.IOException
Writes to a file

Throws:
java.io.IOException

UTF8Writer

public UTF8Writer(java.io.OutputStream f)
Writes to a writer

Method Detail

close

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

flush

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

write

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

write

public void write(int c)
           throws java.io.IOException
Overrides:
write in class java.io.Writer
Throws:
java.io.IOException

writeln

public void writeln(java.lang.String s)
             throws java.io.IOException
Writes a line

Throws:
java.io.IOException

write

public void write(java.lang.String s)
           throws java.io.IOException
Writes a string

Overrides:
write in class java.io.Writer
Throws:
java.io.IOException