public class NewUTF8Reader
extends java.io.Reader
Reader f=new UTF8Reader(new File("blah.blb"));
int c;
while((c=f.read())!=-1) System.out.print(Char.normalize(c));
f.close();
| Modifier and Type | Field and Description |
|---|---|
protected java.io.BufferedReader |
bin
Buffered input stream
|
protected long |
numBytesRead
number of chars for announce
|
protected boolean |
progressBar
tells whether we want a progress bar
|
| Constructor and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected java.io.BufferedReader bin
protected boolean progressBar
protected long numBytesRead
public NewUTF8Reader(java.io.InputStream s)
public NewUTF8Reader(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionpublic NewUTF8Reader(java.io.File f)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic NewUTF8Reader(java.io.File f,
java.lang.String message)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic NewUTF8Reader(java.lang.String f)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic NewUTF8Reader(java.lang.String f,
java.lang.String message)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic long numBytesRead()
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException