Class JFleetAvroWriter<T>

java.lang.Object
org.jfleet.avro.JFleetAvroWriter<T>
All Implemented Interfaces:
Closeable, AutoCloseable, Consumer<T>

public class JFleetAvroWriter<T> extends Object implements Closeable, Consumer<T>
  • Constructor Details

  • Method Details

    • writeAll

      public void writeAll(Collection<T> entities) throws IOException
      Writes the specified Collection of Java objects to an Avro file.
      Parameters:
      entities - the collection of objects to write
      Throws:
      IOException - if an error occurs while writing the records
    • writeAll

      public void writeAll(Stream<T> entities) throws IOException
      Writes the specified stream of Java objects to an Avro file.
      Parameters:
      entities - the stream of objects to write
      Throws:
      IOException - if an error occurs while writing the records
    • write

      public void write(T entity) throws IOException
      Writes the specified Java object to an Avro file.
      Parameters:
      entity - object to write
      Throws:
      IOException - if an error occurs while writing the records
    • accept

      public void accept(T entity)
      Writes the specified Java object to an Avro file implementing Consumer of T
      Specified by:
      accept in interface Consumer<T>
      Parameters:
      entity - object to write
      Throws:
      UncheckedIOException - if an error occurs while writing the records
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException