InputStream inputStream = arg0.getInputStream();
OutputStream outputStream = arg1.getOutputStream();
/*
*This works only with hessian >= hessian-3.0.20!!
*but remember this is not a framework
*/
Hessian2Input hessianInput = new Hessian2Input(inputStream);
if (this.serializerFactory != null) {
hessianInput.setSerializerFactory(this.serializerFactory);
}
int code = hessianInput.read();
if (code != 'c") {
throw new IOException("expected 'c' in hessian input at " + code);
}
AbstractHessianOutput hessianOutput = null;
int major = hessianInput.read();
// useless read just get the stream in the right position.
int minor = hessianInput.read();
if (major >= 2) {
hessianOutput = new Hessian2Output(outputStream);
}
else {
hessianOutput = new HessianOutput(outputStream);
}
if (this.serializerFactory != null) {
hessianOutput.setSerializerFactory(this.serializerFactory);
}
try {
this.skeleton.invoke(hessianInput, hessianOutput);
} catch (Throwable e) {
LOG.error("Unexpected Exception thrown -- "+e.getMessage(),e);
throw e;
}