Interface ObjectOutput
- All Superinterfaces:
DataOutput
Object output interface.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidwriteAttachments(Map<String, Object> attachments) default voidwriteEvent(String data) voidwriteObject(Object obj) write object.default voidwriteThrowable(Throwable obj) The following methods are customized for the requirement of Dubbo's RPC protocol implementation.Methods inherited from interface org.apache.dubbo.common.serialize.DataOutput
flushBuffer, writeBool, writeByte, writeBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Method Details
-
writeObject
write object.- Parameters:
obj- object.- Throws:
IOException
-
writeThrowable
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
- Throws:
IOException
-
writeAttachments
- Throws:
IOException
-