Interface Encoder<E>

    • Method Detail

      • headerBytes

        byte[] headerBytes()
        Get header bytes. This method is typically called upon opening of an output stream.
        Returns:
        header bytes. Null values are allowed.
      • encode

        byte[] encode​(E event)
        Encode an event as bytes.
        Parameters:
        event - the event to encode
        Returns:
        the encoded bytes. Null values are allowed.
      • footerBytes

        byte[] footerBytes()
        Get footer bytes. This method is typically called prior to the closing of the stream where events are written.
        Returns:
        footer bytes. Null values are allowed.
      • isStateful

        default boolean isStateful()
        Returns true if the encoder is stateful, false otherwise.

        A stateful encoder keeps state between invocation of #encode(E event) method.

        A stateful encoder may produce different output for the same input event depending on its internal state. A stateless encoder will always produce the same output for the same input event.

        Returns:
        true if the encoder is stateful, false otherwise.
        Since:
        1.6.4