Interface RecordWriter

  • All Known Implementing Classes:
    CsvWriter, DelimitedWriter, FixedLengthWriter, JsonWriter, XmlWriter

    public interface RecordWriter
    A RecordWriter is used to write records to an output stream. The class used to represent a record is implementation specific and dependent on the format of the output stream. For example, a delimited stream may use String[] objects to define records, while a fixed length based stream may simply use String.
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes the output stream.
      void flush()
      Flushes the output stream.
      void write​(java.lang.Object record)
      Writes a record object to this output stream.
    • Method Detail

      • write

        void write​(java.lang.Object record)
            throws java.io.IOException
        Writes a record object to this output stream.
        Parameters:
        record - the record object to write
        Throws:
        java.io.IOException - if an I/O error occurs writing the record to the stream
      • flush

        void flush()
            throws java.io.IOException
        Flushes the output stream.
        Throws:
        java.io.IOException - if an I/O error occurs flushing the stream
      • close

        void close()
            throws java.io.IOException
        Closes the output stream.
        Throws:
        java.io.IOException - if an I/O error occurs closing the stream