Interface ObjectOutput

All Superinterfaces:
DataOutput

public interface ObjectOutput extends DataOutput
Object output interface.
  • Method Details

    • writeObject

      void writeObject(Object obj) throws IOException
      write object.
      Parameters:
      obj - object.
      Throws:
      IOException
    • writeThrowable

      default void writeThrowable(Throwable obj) throws IOException
      The following methods are customized for the requirement of Dubbo's RPC protocol implementation. Legacy protocol implementation will try to write Map, Throwable and Null value directly to the stream, which does not meet the restrictions of all serialization protocols.

      See how ProtobufSerialization, KryoSerialization implemented these methods for more details.

      The binding of RPC protocol and biz serialization protocol is not a good practice. Encoding of RPC protocol should be highly independent and portable, easy to cross platforms and languages, for example, like the http headers, restricting the content of headers / attachments to Ascii strings and uses ISO_8859_1 to encode them. https://tools.ietf.org/html/rfc7540#section-8.1.2

      Throws:
      IOException
    • writeEvent

      default void writeEvent(String data) throws IOException
      Throws:
      IOException
    • writeAttachments

      default void writeAttachments(Map<String,Object> attachments) throws IOException
      Throws:
      IOException