|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader javatools.test.NewUTF8Reader
public class NewUTF8Reader
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 | |
---|---|
NewUTF8Reader(java.io.File f)
Constructs a UTF8Reader from a File |
|
NewUTF8Reader(java.io.File f,
java.lang.String message)
Constructs a UTF8Reader from a File, makes a nice progress bar, but reads slower, 1GB in 18 seconds with progressbar, 11 seconds without |
|
NewUTF8Reader(java.io.InputStream s)
Constructs a UTF8Reader from a Reader |
|
NewUTF8Reader(java.lang.String f)
Constructs a UTF8Reader from a File |
|
NewUTF8Reader(java.lang.String f,
java.lang.String message)
Constructs a UTF8Reader from a File, makes a nice progress bar, but reads slower, 1GB in 18 seconds with progressbar, 11 seconds without |
|
NewUTF8Reader(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 do not between read() and readLine methods pick one and stick to it. |
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 NewUTF8Reader(java.io.InputStream s)
public NewUTF8Reader(java.net.URL url) throws java.io.IOException
java.io.IOException
public NewUTF8Reader(java.io.File f) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public NewUTF8Reader(java.io.File f, java.lang.String message) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public NewUTF8Reader(java.lang.String f) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public NewUTF8Reader(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 java.lang.String readLine() throws java.io.IOException
java.io.IOException
public long numBytesRead()
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 |