|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.stream.fixedlength.FixedLengthReader
public class FixedLengthReader
A FixedLengthReader is used to read records from a fixed length
file or input stream. A fixed length record is represented using the
String class. Records must be terminated by a single
configurable character, or by default, any of the following: line feed (LF),
carriage return (CR), or CRLF combination.
If a record may span multiple lines, a single line continuation character may be configured. The line continuation character must immediately precede the record termination character. Note that line continuation characters are not included in the record text.
| Constructor Summary | |
|---|---|
FixedLengthReader(Reader in)
Constructs a new FixedLengthReader. |
|
FixedLengthReader(Reader in,
FixedLengthParserConfiguration config)
Constructs a new FixedLengthReader. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this input stream. |
int |
getRecordLineNumber()
Returns the line number of the last record from this input stream. |
String |
getRecordText()
Returns the unparsed record text of the last record read. |
String |
read()
Reads a single record from this input stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedLengthReader(Reader in)
in - the input stream to read from
public FixedLengthReader(Reader in,
FixedLengthParserConfiguration config)
throws IllegalArgumentException
in - the input stream to read fromconfig - the reader configuration settings or null to accept defaults
IllegalArgumentException - if a configuration setting is invalid| Method Detail |
|---|
public int getRecordLineNumber()
RecordReader
getRecordLineNumber in interface RecordReaderpublic String getRecordText()
RecordReader
getRecordText in interface RecordReader
public String read()
throws IOException,
RecordIOException
RecordReader
read in interface RecordReaderIOException - if an I/O error occurs reading from the stream
RecordIOException - if the record is malformed and cannot
be parsed, but subsequent reads may still be possible
public void close()
throws IOException
RecordReader
close in interface RecordReaderIOException - if an I/O error occurs closing the stream
|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||