Closed haiyang1985 closed 3 years ago
How do protobufUtil.serializeWithProtobuf(obj, outputStream);
and protobufUtil.deserializeWithProtobuf(inputStream, clazz);
work?
If we write and read bytes in or out Hessian's OutputStream and InputStream directly, is there any rule we should follow? for example, write some flags to indicate Hessian how to work properly?
Try to call outstream.close ()
everytime.
No feedback for a long time, please close the issue temporarily. If there is still a problem, you can reopen it.
Environment
Steps to reproduce this issue
We are going to support Google PB serialization with Hessian2 as delegate to write buffer to channel. But, the readInputStream cannot parse the tag from the BytesOutputStream.
private void writeStream(Object obj) throws IOException { Hessian2ObjectOutput hessian2ObjectOutput = (Hessian2ObjectOutput) delegate; OutputStream outputStream = hessian2ObjectOutput.getOutput().getBytesOutputStream(); protobufUtil.serializeWithProtobuf(obj, outputStream); }
@Override public InputStream readInputStream() throws IOException { int tag = read();
}
}
@Override public void write(byte[] buffer, int offset, int length) throws IOException { while (length > 0) { int sublen = SIZE - _offset;
}
@Override public void close() throws IOException { int startOffset = _startOffset; _startOffset = -1;
}
Just put your stack trace here!