public class UTF8Reader
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.InputStream |
in
Holds the input Stream
|
protected long |
numBytesRead
number of chars for announce
|
protected boolean |
progressBar
tells whether we want a progress bar
|
| Constructor and Description |
|---|
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
|
| 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
|
protected java.io.InputStream in
protected long numBytesRead
protected boolean progressBar
public UTF8Reader(java.io.InputStream s)
public UTF8Reader(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionpublic UTF8Reader(java.io.File f)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic UTF8Reader(java.io.File f,
java.lang.String message)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic UTF8Reader(java.lang.String f)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic UTF8Reader(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 long numBytesRead()
public java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException