Java
@@
@code
public interface DataBodyFormatter {
void Serialize(ByteBuf writer, T value, Version version);
T Deserialize(ByteBuf reader,Version version);
}
public class DataBodyFormatterFactory {
public DataBodyFormatterFactory() {
}
/**
*系统内的formatters,自动注册*/@Autowired
Map formatters;
}
public DataBodyFormatter getDataBodyFormatter(long code, boolean isReply) {
}
# 使用,默认就是object
dataBodyFormatter = _DataBodyFactory.getDataBodyFormatter(code, isClientMode());
而在NET中
@@
@code
public interface IDataBodyFormatterBase
{
object Deserialize(IByteBuffer reader, Version version);
}
public interface IDataBodyFormatter : IDataBodyFormatterBase
{
void Serialize(IByteBuffer writer, T value, Version v.........