final class OctaveExecuteReader extends Reader
| Modifier and Type | Field and Description |
|---|---|
private StringBuffer |
buffer
The current line read from
octaveReader
but not yet passed to a char-array by read(char[], int, int). |
private boolean |
eof
Whether end of reader found.
|
private boolean |
firstLine
Whether reading the first line.
|
private static org.apache.commons.logging.Log |
LOG |
private BufferedReader |
octaveReader
The wrapped reader.
|
private String |
spacer
The string signifying end of stream.
|
| Constructor and Description |
|---|
OctaveExecuteReader(BufferedReader octaveReader,
String spacer)
This reader will read from
octaveReader
until a single line equal() spacer is read,
after that this reader will return eof. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array.
|
private static final org.apache.commons.logging.Log LOG
private final BufferedReader octaveReader
private final String spacer
private StringBuffer buffer
octaveReader
but not yet passed to a char-array by read(char[], int, int).
If this buffer were empty, it is null instead,
which is also the initial value.
If this is not the first line, the line read from octaveReader
is preceeded by newline before being passed to buffer.private boolean firstLine
read(char[], int, int)
if buffer is filled for the first time.private boolean eof
read(char[], int, int)
if buffer equals spacer,
not really end of octaveReader.OctaveExecuteReader(BufferedReader octaveReader, String spacer)
octaveReader
until a single line equal() spacer is read,
after that this reader will return eof.
When this reader is closed it will update the state of octave to NONE.octaveReader - the wrapped readerspacer - the line signifying end of stream.public int read(char[] cbuf,
int off,
int len)
throws IOException
read in class Readercbuf - Destination bufferoff - Offset at which to start storing characters.len - Maximum number of characters to read.eof is set
which means that line spacer has been found.IOException - If an I/O error occurs.
This is true in particular,
if null-line has been read from octaveReader.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionCopyright © 2006–2018 Simuline Organization (l2r). All rights reserved.