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


Java Hessian2Input类代码示例

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


Hessian2Input类属于com.caucho.hessian.io包,在下文中一共展示了Hessian2Input类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: readHashMap

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
public static HashMap<String, Integer> readHashMap(Hessian2Input dis, Integer[] allInts) {
    int count;
    HashMap<String, Integer> tileMap = null;
    String[] keys;
    try {
        // TODO - The following read is necessary, but could be removed in a future version
        dis.readInt();//size = dis.readInt();
        count = dis.readInt();
        tileMap = new HashMap<String, Integer>(count);
        keys = new String[count];
        for (int i = 0; i < keys.length; i++) {
            keys[i] = dis.readString();
        }
        for (int i = 0; i < count; i++) {
            tileMap.put(keys[i], allInts[dis.readInt()]);
        }

    } catch (IOException e) {
        MessageGenerator.briefErrorAndExit("Error in readHashMap()");
    }
    return tileMap;
}
 
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:23,代码来源:FileTools.java

示例4: readStringMultiMap

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
public static HashMap<String, ArrayList<String>> readStringMultiMap(Hessian2Input dis) {
    int count;
    HashMap<String, ArrayList<String>> map = null;
    try {
        count = dis.readInt();
        map = new HashMap<String, ArrayList<String>>(count);
        for (int i = 0; i < count; i++) {
            String key = dis.readString();
            int valueCount = dis.readInt();
            ArrayList<String> value = new ArrayList<String>(valueCount);
            for (int j = 0; j < valueCount; j++) {
                value.add(dis.readString());
            }
            map.put(key, value);
        }

    } catch (IOException e) {
        MessageGenerator.briefErrorAndExit("Error in readStringMultiMap()");
    }
    return map;
}
 
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:22,代码来源:FileTools.java

示例5: readWireHashMap

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
public static WireHashMap readWireHashMap(Hessian2Input dis, ArrayList<WireConnection[]> wires, ArrayList<WireArrayConnection> wireConnections) {
    int[] intArray = readIntArray(dis);

    if (intArray == null) {
        return null;
    }

    WireHashMap newMap = new WireHashMap((int) (intArray.length * 1.3f));

    for (int i : intArray) {
        WireArrayConnection wc = wireConnections.get(i);
        newMap.put(wc.wire, wires.get(wc.wireArrayEnum));
    }

    return newMap;
}
 
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:17,代码来源:FileTools.java

示例6: 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

示例7: decodeResponse

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
@Override
public RpcResponse decodeResponse(InputStream inputStream)
		throws IOException {
	  Hessian2Input in = new Hessian2Input(inputStream);  
	  RpcResponse obj = (RpcResponse)in.readObject();  
	  return obj;
}
 
开发者ID:zhaoshiling1017,项目名称:voyage,代码行数:8,代码来源:HessianSerializer.java

示例8: toObject

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
public T toObject(byte[] bytes, int offset, int length) {
    T object = null;
    try {
        object = (T) new Hessian2Input(new ByteArrayInputStream(bytes, offset, length)).readObject();
        return object;
    }
    catch (java.io.IOException ioe) {
        throw new RuntimeException(ioe.getMessage(), ioe);
    }
}
 
开发者ID:viant,项目名称:CacheStore,代码行数:11,代码来源:HessianSerializer.java

示例9: readExternal

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
/**
 * using Hessian-SM serialize protocol
 * @param in Hessian2Input
 * @throws IOException
 */
@Override
public void readExternal(Hessian2Input in) throws IOException {
    opType = OpType.getOpType( (byte) in.readInt());
    remove = (byte) in.readInt();
    errorCode = in.readInt();
    key = BlockUtil.toKey( in.readBytes());
    //value is not null
    boolean isNull = in.readBoolean();
    if ( ! isNull  ) {
        value = Utils.bytesToValue( in.readBytes());
    }
}
 
开发者ID:viant,项目名称:CacheStore,代码行数:18,代码来源:StoreParas.java

示例10: readExternal

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
@Override
public void readExternal(Hessian2Input in) throws IOException {
    opType = OpType.getOpType( (byte) in.readInt());
    boolean isNull = in.readBoolean();
    if ( ! isNull ) {
        int size = in.readInt();
        list = new ArrayList<StoreParas>(size);
        for ( int i = 0; i < size ; i++) {
            System.out.println("j= "+i);
            StoreParas paras = (StoreParas) in.readObject();
            //StoreParas paras = StoreParas.toStoreParas(in.readBytes());
            list.add( paras);
        }
    }
}
 
开发者ID:viant,项目名称:CacheStore,代码行数:16,代码来源:StoreParaList.java

示例11: 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

示例12: fromByteArray

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@SneakyThrows
@Override
public T fromByteArray(byte[] bytes) throws MetaClientException {
    checkNotNull(bytes);
    try (ByteArrayInputStream is = new ByteArrayInputStream(bytes)) {
        Hessian2Input hi = new Hessian2Input(is);
        return (T) hi.readObject();
    }
}
 
开发者ID:srarcbrsent,项目名称:tc,代码行数:11,代码来源:TcHessianSerializationMessageBodyConverter.java

示例13: deserialize

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
@Override
public Object deserialize(byte[] bytes) throws Exception {
    if(null == bytes || bytes.length == 0) {
        return null;
    }
    ByteArrayInputStream inputStream=new ByteArrayInputStream(bytes);
    AbstractHessianInput input=new Hessian2Input(inputStream);
    input.setSerializerFactory(serializerFactory);
    Object obj=input.readObject();
    input.close();
    return obj;
}
 
开发者ID:hailin0,项目名称:pagecache-parent,代码行数:13,代码来源:HessianSerializer.java

示例14: 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

示例15: deserialize

import com.caucho.hessian.io.Hessian2Input; //导入依赖的package包/类
@Override
public  Object deserialize(byte[] data) {
	ByteArrayInputStream is = new ByteArrayInputStream(data);
	Hessian2Input hi = new Hessian2Input(is);  
	Object obj=null;
	try {
		obj = hi.readObject();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return obj;
}
 
开发者ID:addisonli,项目名称:addison-common-cached,代码行数:14,代码来源:Hessian2Serialize.java


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