-
Notifications
You must be signed in to change notification settings - Fork 26.5k
export hessian InputStream & OutputStream for serialization extension #5781
Copy link
Copy link
Closed
Milestone
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 2.7.3
- Operating System version: macOs
- Java version: JDK 1.8
Steps to reproduce this issue
We are going to serialize direct to Hessian OutputStream for protobuf extension, and read directly from InputStream. The change is going to export the Hessian InputStream & OutputStream for direct write.
private final Hessian2ObjectOutput delegate;
protected ProtobufObjectOutput(OutputStream os) {
this.delegate = new Hessian2ObjectOutput(os);
}
void writeBytesForPBObject(Object obj, Class clazz) throws IOException {
try (OutputStream os = delegate.getOutputStream()) {
if (obj instanceof MessageLite) {
try {
((MessageLite) obj).writeTo(os);
} catch (IOException e) {
throw new RuntimeException("Google PB序列化失败,序列化对象的类型为" + obj.getClass().getName(), e);
}
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.