use of com.caucho.hessian.io.HessianSerializerOutput in project httpx by servicex-sh.
the class SofaRpcInvocation method content.
public byte[] content() throws Exception {
SofaRequest request = new SofaRequest();
request.setTargetServiceUniqueName(this.targetServiceUniqueName);
request.setMethodName(this.methodName);
request.setMethodArgSigs(this.methodArgSigs);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Hessian2Output out = new HessianSerializerOutput(bos);
out.writeObject(request);
if (stubArguments != null) {
for (Object argument : stubArguments) {
out.writeObject(argument);
}
}
out.flush();
return bos.toByteArray();
}
use of com.caucho.hessian.io.HessianSerializerOutput in project httpx by servicex-sh.
the class DubboRpcInvocation method toBytes.
public byte[] toBytes() throws Exception {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Hessian2Output out = new HessianSerializerOutput(bos);
out.writeString("2.0.2");
out.writeString(serviceName);
out.writeString("0.0.0");
out.writeString(methodStub);
out.writeString(parameterTypesDesc);
for (Object argument : stubArguments) {
out.writeObject(argument);
}
out.writeObject(attachments);
out.flush();
return bos.toByteArray();
}
use of com.caucho.hessian.io.HessianSerializerOutput in project httpx by servicex-sh.
the class DubboRpcInvocationTest method testHessian.
@Test
public void testHessian() throws Exception {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Hessian2Output out = new HessianSerializerOutput(bos);
out.writeString("hi, Jackie");
out.flush();
byte[] bytes = bos.toByteArray();
for (int i = 0; i < bytes.length; i++) {
System.out.printf("%02X ", bytes[i]);
}
}
use of com.caucho.hessian.io.HessianSerializerOutput in project alibaba-rsocket-broker by alibaba.
the class HessianTest method testEncode.
@Test
public void testEncode() throws Exception {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
HessianSerializerOutput output = new HessianSerializerOutput(bos);
output.writeObject(args);
output.flush();
content = bos.toByteArray();
System.out.println(content.length);
}
use of com.caucho.hessian.io.HessianSerializerOutput in project alibaba-rsocket-broker by alibaba.
the class HessianTest method testEncodeInteger.
@Test
public void testEncodeInteger() throws Exception {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
HessianSerializerOutput output = new HessianSerializerOutput(bos);
output.writeObject(1);
output.flush();
content = bos.toByteArray();
Assertions.assertEquals(content[0], -111);
}
Aggregations