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
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes this input stream.
      int getRecordLineNumber()
      Returns the line number of the last record from this input stream.
      java.lang.String getRecordText()
      Returns the unparsed record text of the last record read.
      java.lang.Object read()
      Reads a single record from this input stream.
    • Method Detail

      • read

        java.lang.Object read()
                       throws java.io.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:
        java.io.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 java.io.IOException
        Closes this input stream.
        Throws:
        java.io.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

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