public class UTF8Reader extends 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 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(File f)
Constructs a UTF8Reader from a File
|
UTF8Reader(File f,
String message)
Constructs a UTF8Reader from a File, makes a nice progress bar
|
UTF8Reader(InputStream s)
Constructs a UTF8Reader from a Reader
|
UTF8Reader(String f)
Constructs a UTF8Reader from a File
|
UTF8Reader(String f,
String message)
Constructs a UTF8Reader from a File, makes a nice progress bar
|
UTF8Reader(URL url)
Constructs a UTF8Reader for an URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
main(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) |
String |
readLine()
Reads a line
|
protected InputStream in
protected long numBytesRead
protected boolean progressBar
public UTF8Reader(InputStream s)
public UTF8Reader(URL url) throws IOException
IOExceptionpublic UTF8Reader(File f) throws FileNotFoundException
FileNotFoundExceptionpublic UTF8Reader(File f, String message) throws FileNotFoundException
FileNotFoundExceptionpublic UTF8Reader(String f) throws FileNotFoundException
FileNotFoundExceptionpublic UTF8Reader(String f, String message) throws FileNotFoundException
FileNotFoundExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws IOException
read in class ReaderIOExceptionpublic int read()
throws IOException
read in class ReaderIOExceptionpublic long numBytesRead()
public String readLine() throws IOException
IOExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2018. All rights reserved.