Interface Serializer<T>

Type Parameters:
T - generic type.

@LimitedPrivate({"HDFS","MapReduce"}) @Evolving public interface Serializer<T>

Provides a facility for serializing objects of type <T> to an OutputStream.

Serializers are stateful, but must not buffer the output since other producers may write to the output between calls to serialize(Object).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the underlying output stream and clear up any resources.
    void
    Prepare the serializer for writing.
    void
    Serialize t to the underlying output stream.
  • Method Details

    • open

      void open(OutputStream out) throws IOException

      Prepare the serializer for writing.

      Parameters:
      out - output stream.
      Throws:
      IOException - raised on errors performing I/O.
    • serialize

      void serialize(T t) throws IOException

      Serialize t to the underlying output stream.

      Parameters:
      t - t.
      Throws:
      IOException - raised on errors performing I/O.
    • close

      void close() throws IOException

      Close the underlying output stream and clear up any resources.

      Throws:
      IOException - raised on errors performing I/O.