|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader javatools.filehandlers.UTF8Reader
public class UTF8Reader
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 class can read characters from a file that is UTF8 encoded.
Example:
Reader f=new UTF8Reader(new File("blah.blb")); int c; while((c=f.read())!=-1) System.out.print(Char.normalize(c)); f.close();
Constructor Summary | |
---|---|
UTF8Reader(java.io.File f)
Constructs a UTF8Reader from a File |
|
UTF8Reader(java.io.File f,
java.lang.String message)
Constructs a UTF8Reader from a File, makes a nice progress bar |
|
UTF8Reader(java.io.InputStream s)
Constructs a UTF8Reader from a Reader |
|
UTF8Reader(java.lang.String f)
Constructs a UTF8Reader from a File |
|
UTF8Reader(java.lang.String f,
java.lang.String message)
Constructs a UTF8Reader from a File, makes a nice progress bar |
|
UTF8Reader(java.net.URL url)
Constructs a UTF8Reader for an URL |
Method Summary | |
---|---|
void |
close()
|
static void |
main(java.lang.String[] args)
Test method |
long |
numBytesRead()
Returns the number of bytes read from the underlying stream |
int |
read()
|
int |
read(char[] cbuf,
int off,
int len)
|
java.lang.String |
readLine()
Reads a line |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UTF8Reader(java.io.InputStream s)
public UTF8Reader(java.net.URL url) throws java.io.IOException
java.io.IOException
public UTF8Reader(java.io.File f) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public UTF8Reader(java.io.File f, java.lang.String message) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public UTF8Reader(java.lang.String f) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public UTF8Reader(java.lang.String f, java.lang.String message) throws java.io.FileNotFoundException
java.io.FileNotFoundException
Method Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public long numBytesRead()
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |