本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}