Interface ItemEncoder<T>

  • All Superinterfaces:
    AutoCloseable, Closeable
    All Known Implementing Classes:
    AbstractOutputStreamItemEncoder, AvroEncoder, CSVEncoder

    public interface ItemEncoder<T>
    extends Closeable
    A functional interface for stateful encoders, encoding object into some binary destination. Each encoder should have a corresponding EncoderFactory, which is the type that pipes work with. Implementations typically receive a non-buffered output stream in their constructor, and do the necessary pre-processing (such as adding a buffered wrapper) there.
    Author:
    Eyal Schneider
    • Method Detail

      • encode

        void encode​(T item)
             throws IOException
        Parameters:
        item - The item to encode into the output stream provided at construction type
        Throws:
        IOException - In case of write error