接口 Serialization
-
@SPI(value="hessian2", scope=FRAMEWORK) public interface Serialization
Serialization strategy interface that specifies a serializer. (SPI, Singleton, ThreadSafe) The default extension is hessian2 and the default serialization implementation of the dubbo protocol.e.g. <dubbo:protocol serialization="xxx" />
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ObjectInputdeserialize(URL url, InputStream input)Get a deserialization implementation instanceStringgetContentType()Get content typebytegetContentTypeId()Get content type unique id, recommended that custom implementations use values different with any value ofConstantsand don't greater than ExchangeCodec.SERIALIZATION_MASK (31) because dubbo protocol use 5 bits to record serialization ID in header.ObjectOutputserialize(URL url, OutputStream output)Get a serialization implementation instance
-
-
-
方法详细资料
-
getContentTypeId
byte getContentTypeId()
Get content type unique id, recommended that custom implementations use values different with any value ofConstantsand don't greater than ExchangeCodec.SERIALIZATION_MASK (31) because dubbo protocol use 5 bits to record serialization ID in header.- 返回:
- content type id
-
getContentType
String getContentType()
Get content type- 返回:
- content type
-
serialize
@Adaptive ObjectOutput serialize(URL url, OutputStream output) throws IOException
Get a serialization implementation instance- 参数:
url- URL address for the remote serviceoutput- the underlying output stream- 返回:
- serializer
- 抛出:
IOException
-
deserialize
@Adaptive ObjectInput deserialize(URL url, InputStream input) throws IOException
Get a deserialization implementation instance- 参数:
url- URL address for the remote serviceinput- the underlying input stream- 返回:
- deserializer
- 抛出:
IOException
-
-