本文整理汇总了Java中com.caucho.hessian.io.Hessian2Input.completeMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Hessian2Input.completeMessage方法的具体用法?Java Hessian2Input.completeMessage怎么用?Java Hessian2Input.completeMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.caucho.hessian.io.Hessian2Input
的用法示例。
在下文中一共展示了Hessian2Input.completeMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unmarshal
import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@Override
public Object unmarshal(final Exchange exchange, final InputStream inputStream) throws Exception {
final Hessian2Input in = new Hessian2Input(inputStream);
try {
in.startMessage();
final Object obj = in.readObject();
in.completeMessage();
return obj;
} finally {
try {
in.close();
} catch (IOException e) {
// ignore
}
}
}
示例2: deserialize
import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@Override
public Object deserialize(InputStream input) {
Object result = null;
try {
Hessian2Input hi = new Hessian2Input(input);
hi.startMessage();
result = hi.readObject();
hi.completeMessage();
hi.close();
input.close();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
示例3: deserialize
import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> T deserialize(byte[] data, Class<T> clazz) throws Exception {
UnsafeByteArrayInputStream bin = new UnsafeByteArrayInputStream(data);
Hessian2Input in = new Hessian2Input(bin);
in.startMessage();
Object obj = in.readObject(clazz);
in.completeMessage();
in.close();
return (T) obj;
}
示例4: readFrom
import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T readFrom(InternalRequest<Object> request, Type<T> clazz) {
try {
Hessian2Input in = new Hessian2Input(request.getInputStream());
in.startMessage();
T object = (T) in.readObject();
in.completeMessage();
return object;
} catch (IOException e) {
throw new RuntimeException("An error occurred during unmarshalling from Hessian.", e);
}
}