Interface Encoder

  • All Known Subinterfaces:
    Codec

    public interface Encoder
    Defines method to encode data.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void encode​(java.nio.ByteBuffer data, java.io.OutputStream outputStream)
      Implementation should encode the remaining bytes in the buffer and return a new ByteBuffer that includes the encoded data at its current position.
      io.pravega.schemaregistry.contract.data.CodecType getCodecType()
      Codec type for the encoder.
    • Method Detail

      • getCodecType

        io.pravega.schemaregistry.contract.data.CodecType getCodecType()
        Codec type for the encoder.
        Returns:
        Codec Type for the encoder.
      • encode

        void encode​(java.nio.ByteBuffer data,
                    java.io.OutputStream outputStream)
             throws java.io.IOException
        Implementation should encode the remaining bytes in the buffer and return a new ByteBuffer that includes the encoded data at its current position. The implementation can optionally call flush or close on outputstream with no consequence.
        Parameters:
        data - ByteBuffer to encode.
        outputStream - OutputStream where the encoded data should be written.
        Throws:
        java.io.IOException - IOException can be thrown while reading from or writing to byte buffers.