|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.util.Errorable
ewe.io.StreamReader
This is used for reading cr/lf delimited lines from a Stream or InputStream, and is far more effecient than a BufferedReader - but has less functionality.
| Field Summary | |
int |
bufferSize
A buffer size to use - by default it is 1024 - however increasing this may not make a significant increase in performance. |
protected boolean |
closed
Indicates if the stream is closed or not. |
String |
encoding
Set this to be a text encoding form. |
protected InputStream |
input
The underlying InputStream if one is used. |
protected Stream |
stream
The underlying Stream if one is used. |
static String |
UTF8
This is the "UTF8" constant string. |
| Fields inherited from class ewe.util.Errorable |
error |
| Constructor Summary | |
StreamReader(BasicStream s)
Create a StreamReader from a Stream or BasicStream which has been opened for input. |
|
StreamReader(File inputFile)
Create a StreamReader from a File object. |
|
StreamReader(InputStream in)
Create a StreamReader from an InputStream. |
|
StreamReader(String path)
Create a StreamReader from a file name. |
|
| Method Summary | |
boolean |
close()
Close the StreamReader and underlying stream. |
boolean |
isOpen()
Returns if the StreamReader is open. |
void |
pushback(String text)
This will pushback some text into the stream. |
String |
readALine()
This reads in a line of text which was terminated in the stream by a Line Feed (\n) or a Carriage Return (\r) or a CR followed by LF (\r\n) or by the end of the file. |
String |
readLine()
Deprecated. use readALine() instead which throws an exception on error. |
protected boolean |
readMore()
Read more into the internal buffer. |
| Methods inherited from class ewe.util.Errorable |
returnError, returnError, returnError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public int bufferSize
protected Stream stream
protected InputStream input
protected boolean closed
public static final String UTF8
public String encoding
| Constructor Detail |
public StreamReader(BasicStream s)
public StreamReader(String path)
throws IOException
public StreamReader(InputStream in)
public StreamReader(File inputFile)
throws IOException
| Method Detail |
public boolean isOpen()
protected boolean readMore()
public String readALine()
throws IOException
IOException - on an input error.public String readLine()
public boolean close()
public void pushback(String text)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||