public interface ObjectOutput extends DataOutput
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
writeAttachments(Map<String,Object> attachments) |
default void |
writeEvent(Object data) |
void |
writeObject(Object obj)
write object.
|
default void |
writeThrowable(Object obj)
The following methods are customized for the requirement of Dubbo's RPC protocol implementation.
|
flushBuffer, writeBool, writeByte, writeBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFvoid writeObject(Object obj) throws IOException
obj - object.IOExceptiondefault void writeThrowable(Object obj) throws IOException
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
IOExceptiondefault void writeEvent(Object data) throws IOException
IOExceptiondefault void writeAttachments(Map<String,Object> attachments) throws IOException
IOExceptionCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.