Class ColumnFileWriter

java.lang.Object
org.apache.trevni.ColumnFileWriter

public class ColumnFileWriter extends Object
Writes data to a column file. All data is buffered until writeTo(File) is called.
  • Constructor Details

  • Method Details

    • sizeEstimate

      public long sizeEstimate()
      Return the approximate size of the file that will be written. Tries to slightly over-estimate. Indicates both the size in memory of the buffered data as well as the size of the file that will be written by writeTo(OutputStream).
    • getMetaData

      public ColumnFileMetaData getMetaData()
      Return this file's metadata.
    • getColumnCount

      public int getColumnCount()
      Return the number of columns in the file.
    • writeRow

      public void writeRow(Object... row) throws IOException
      Add a row to the file.
      Throws:
      IOException
    • startRow

      public void startRow() throws IOException
      Expert: Called before any values are written to a row.
      Throws:
      IOException
    • writeLength

      public void writeLength(int length, int column) throws IOException
      Expert: Declare a count of items to be written to an array column or a column whose parent is an array.
      Throws:
      IOException
    • writeValue

      public void writeValue(Object value, int column) throws IOException
      Expert: Add a value to a row. For values in array columns or whose parents are array columns, this must be preceded by a call to writeLength(int, int) and must be called that many times. For normal columns this is called once for each row in the column.
      Throws:
      IOException
    • endRow

      public void endRow() throws IOException
      Expert: Called after all values are written to a row.
      Throws:
      IOException
    • writeTo

      public void writeTo(File file) throws IOException
      Write all rows added to the named file.
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Write all rows added to the named output stream.
      Throws:
      IOException