当前位置: 首页>>代码示例>>Java>>正文


Java Hessian2Input.close方法代码示例

本文整理汇总了Java中com.caucho.hessian.io.Hessian2Input.close方法的典型用法代码示例。如果您正苦于以下问题:Java Hessian2Input.close方法的具体用法?Java Hessian2Input.close怎么用?Java Hessian2Input.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.caucho.hessian.io.Hessian2Input的用法示例。


在下文中一共展示了Hessian2Input.close方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decode

import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@Override
protected Object decode(ChannelHandlerContext ctx, Channel channel,
		ChannelBuffer buffer) throws Exception {
	ChannelBuffer frame = (ChannelBuffer) super
			.decode(ctx, channel, buffer);
	if (frame == null) {
		return null;
	}
	ChannelBufferInputStream in = new ChannelBufferInputStream(frame);
	Hessian2Input jim = new Hessian2Input(in);
	try {
		Object o = jim.readObject();
		return o;
	} finally {
		jim.close();
	}
}
 
开发者ID:jbeetle,项目名称:BJAF3.x,代码行数:18,代码来源:HessianDecoder.java

示例2: 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
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:HessianDataFormat.java

示例3: 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;
}
 
开发者ID:yu199195,项目名称:happylifeplat-transaction,代码行数:16,代码来源:HessianSerialize.java

示例4: decode

import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
public Object decode(String className, byte[] bytes) throws Exception {
  Hessian2Input input = new Hessian2Input(new ByteArrayInputStream(bytes));
  // avoid child object to parent object problem
  Object resultObject = input.readObject();
  input.close();
  return resultObject;
}
 
开发者ID:leeyazhou,项目名称:nfs-rpc,代码行数:8,代码来源:HessianDecoder.java

示例5: 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;
   }
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:13,代码来源:Hessian2Serializable.java

示例6: loadFromCompressedFile

import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
public static Object loadFromCompressedFile(String fileName) {
    Hessian2Input his = getInputStream(fileName);
    try {
        Object o = his.readObject();
        his.close();
        return o;
    } catch (IOException e) {
        return null;
    }
}
 
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:11,代码来源:FileTools.java

示例7: read

import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
private static Object read(byte[] data) throws Exception {
    ByteArrayInputStream inputStream=new ByteArrayInputStream(data);
    Hessian2Input input=new Hessian2Input(inputStream);
    input.setSerializerFactory(SERIALIZER_FACTORY);
    // Simple someObject = kryo.readObject(input, Simple.class);
    Object obj=input.readObject();
    input.close();
    // System.out.println(someObject.getCacheObject());
    return obj;
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache,代码行数:11,代码来源:HessianTest.java

示例8: deSerialize

import com.caucho.hessian.io.Hessian2Input; //导入方法依赖的package包/类
@Override
public Object deSerialize(byte[] byteBuf) throws IOException {
	Hessian2Input input = new Hessian2Input(new ByteArrayInputStream(byteBuf));
	Object resultObject = input.readObject();
	input.close();
	return resultObject;
}
 
开发者ID:ReliefZk,项目名称:minor-rpc,代码行数:8,代码来源:HessianSerializer.java


注:本文中的com.caucho.hessian.io.Hessian2Input.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。