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


Java FSTObjectInput.read方法代码示例

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


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

示例1: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee,
                          int streamPosition) throws Exception {
    int len = in.readInt();
    byte[] buf = new byte[len];
    in.read(buf);
    BigInteger bigInteger = new BigInteger(buf);
    in.registerObject(bigInteger,streamPosition,serializationInfo,referencee);
    return bigInteger;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:11,代码来源:FSTBigIntegerSerializer.java

示例2: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception {
    int len = in.readFInt();
    byte bytes[] = new byte[len];

    if ( COMPRESS ) {
        int intsiz = len/4;
        int count = 0;
        for ( int n=0; n<intsiz;n++ ) {
            int value = 0;
            int i = 0;
            int b;
            while (((b = in.readByte()) & 0x80) != 0) {
                value |= (b & 0x7F) << i;
                i += 7;
            }
            value = value | (b << i);
            int temp = (((value << 31) >> 31) ^ value) >> 1;
            value = temp ^ (value & (1 << 31));

            bytes[count++] = (byte) ((value >>> 0) & 0xFF);
            bytes[count++] = (byte) ((value >>>  8) & 0xFF);
            bytes[count++] = (byte) ((value >>> 16) & 0xFF);
            bytes[count++] = (byte) ((value >>> 24) & 0xFF);
        }
        int remainder = len&3;
        for ( int i = 0; i < remainder; i++) {
            bytes[count++] = in.readByte();
        }
    } else {
        in.read(bytes);
    }
    HeapBytez hb = new HeapBytez(bytes);
    return FSTStructFactory.getInstance().createStructWrapper(hb, 0);
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:36,代码来源:FSTStructSerializer.java

示例3: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTFieldInfo referencee,
		int streamPosition) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
	byte[] buf = new byte[in.readInt()];
	in.read(buf);
	PeerAddress address = new PeerAddress(buf);
	in.registerObject(address, streamPosition, serializationInfo, referencee);
	return address;
}
 
开发者ID:Hive2Hive,项目名称:Hive2Hive,代码行数:10,代码来源:FSTPeerAddressSerializer.java


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