本文整理汇总了Java中org.nustaq.serialization.FSTObjectOutput.writeStringUTF方法的典型用法代码示例。如果您正苦于以下问题:Java FSTObjectOutput.writeStringUTF方法的具体用法?Java FSTObjectOutput.writeStringUTF怎么用?Java FSTObjectOutput.writeStringUTF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.nustaq.serialization.FSTObjectOutput
的用法示例。
在下文中一共展示了FSTObjectOutput.writeStringUTF方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
EnumSet enset = (EnumSet) toWrite;
int count = 0;
out.writeInt(enset.size());
if ( enset.isEmpty() ) { //WTF only way to determine enumtype ..
EnumSet compl = EnumSet.complementOf(enset);
out.writeStringUTF(FSTUtil.getRealEnumClass(compl.iterator().next().getClass()).getName());
} else {
for (Object element : enset) {
if ( count == 0 ) {
out.writeStringUTF(FSTUtil.getRealEnumClass(element.getClass()).getName());
}
out.writeStringUTF(element.toString());
count++;
}
}
}
示例2: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
Class cls = (Class) toWrite;
out.writeBoolean(cls.isPrimitive());
out.writeStringUTF(cls.getName());
}
示例3: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
out.writeStringUTF((String) toWrite);
}
示例4: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
out.writeStringUTF(toWrite.toString());
}
示例5: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
Throwable th = (Throwable) toWrite;
out.writeStringUTF(th.getMessage());
}
示例6: writeObject
import org.nustaq.serialization.FSTObjectOutput; //导入方法依赖的package包/类
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
out.writeStringUTF(toWrite.toString()); // cruel slow stuff
}