BeanIO 2.0.4

org.beanio.stream
Interface RecordReader

All Known Implementing Classes:
CsvReader, DelimitedReader, FixedLengthReader, JsonReader, XmlReader

public interface RecordReader

A RecordReader is used to divide an input stream into records. The Java class used to represent a record is implementation specific and dependent on the format of the input stream.

Since:
1.0
Author:
Kevin Seim

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.
 Object read()
          Reads a single record from this input stream.
 

Method Detail

read

Object read()
            throws IOException,
                   RecordIOException
Reads a single record from this input stream. The type of object returned depends on the format of the stream.

Returns:
the record value, or null if the end of the stream was reached.
Throws:
IOException - 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

close

void close()
           throws IOException
Closes this input stream.

Throws:
IOException - if an I/O error occurs closing the stream

getRecordLineNumber

int getRecordLineNumber()
Returns the line number of the last record from this input stream. If a record spans multiple lines, the line number at the beginning of the record is returned. May return -1 if the end of the stream was reached, or 0 if new lines are not used to terminate records.

Returns:
the beginning line number of the last record read

getRecordText

String getRecordText()
Returns the unparsed record text of the last record read.

Returns:
the unparsed text of the last record read

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim