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


Java FSTObjectInput.readStringUTF方法代码示例

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


在下文中一共展示了FSTObjectInput.readStringUTF方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 {
    String s = in.readStringUTF();
    StringBuilder stringBuilder = new StringBuilder(s);
    in.registerObject(stringBuilder, streamPosition,serializationInfo, referencee);
    return stringBuilder;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:8,代码来源:FSTStringBuilderSerializer.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 {
    boolean isPrimitive = in.readBoolean();
    String name = in.readStringUTF();
    Class cls = isPrimitive ? primitiveMap.get(name) : in.getClassForName(name);
    in.registerObject(cls, streamPosition, serializationInfo, referencee);
    return cls;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:9,代码来源:FSTClassSerializer.java

示例3: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception {
    String msg = in.readStringUTF();
    try {
        Constructor constructor = objectClass.getConstructor(String.class);
        return constructor.newInstance(msg);
    } catch (Exception e) {
        return new Throwable("unable to deserialize original exception with message:"+msg);
    }
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:11,代码来源:FSTCPThrowableSerializer.java

示例4: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception {
    String s = in.readStringUTF();
    StringBuffer stringBuffer = new StringBuffer(s);
    in.registerObject(stringBuffer, streamPosition, serializationInfo, referencee);
    return stringBuffer;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:8,代码来源:FSTStringBufferSerializer.java

示例5: 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();
    Class elemCl = FSTUtil.getRealEnumClass(in.getClassForName( in.readStringUTF() ));
    EnumSet enSet = EnumSet.noneOf(elemCl);
    in.registerObject(enSet,streamPosition,serializationInfo, referencee); // IMPORTANT, else tracking double objects will fail
    for (int i = 0; i < len; i++) {
        String val = in.readStringUTF();
        enSet.add(Enum.valueOf(elemCl,val));
    }
    return enSet;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:13,代码来源:FSTCPEnumSetSerializer.java

示例6: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception {
    String s = in.readStringUTF();
    in.registerObject(s, streamPosition, serializationInfo, referencee);
    return s;
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:7,代码来源:FSTStringSerializer.java

示例7: instantiate

import org.nustaq.serialization.FSTObjectInput; //导入方法依赖的package包/类
@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception {
    return new BigDecimal(in.readStringUTF());
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:5,代码来源:FSTJSonSerializers.java


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