public class GenericProtobufSerialization extends Object implements Serialization
Currently, the Dubbo protocol / framework data, such as attachments, event data, etc., depends on business layer serialization protocol to do serialization before transmitted. That's a problem when using Protobuf as business serialization protocol, because Protobuf does not support raw java Object types, to solve it, we can use one of the following methods:
| 构造器和说明 |
|---|
GenericProtobufSerialization() |
| 限定符和类型 | 方法和说明 |
|---|---|
ObjectInput |
deserialize(URL url,
InputStream input)
Get a deserialization implementation instance
|
String |
getContentType()
Get content type
|
byte |
getContentTypeId()
Get content type unique id, recommended that custom implementations use values different with
any value of
Constants and don't greater than ExchangeCodec.SERIALIZATION_MASK (31)
because dubbo protocol use 5 bits to record serialization ID in header. |
ObjectOutput |
serialize(URL url,
OutputStream output)
Get a serialization implementation instance
|
public byte getContentTypeId()
SerializationConstants and don't greater than ExchangeCodec.SERIALIZATION_MASK (31)
because dubbo protocol use 5 bits to record serialization ID in header.getContentTypeId 在接口中 Serializationpublic String getContentType()
SerializationgetContentType 在接口中 Serializationpublic ObjectOutput serialize(URL url, OutputStream output)
Serializationserialize 在接口中 Serializationurl - URL address for the remote serviceoutput - the underlying output streampublic ObjectInput deserialize(URL url, InputStream input)
Serializationdeserialize 在接口中 Serializationurl - URL address for the remote serviceinput - the underlying input streamCopyright © 2011–2021 The Apache Software Foundation. All rights reserved.