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


Java FSTObjectOutput.writeStringUTF方法代码示例

本文整理汇总了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++;
        }
    }
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:19,代码来源:FSTCPEnumSetSerializer.java

示例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());
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:7,代码来源:FSTClassSerializer.java

示例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);
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:5,代码来源:FSTStringSerializer.java

示例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());
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:5,代码来源:FSTJSonSerializers.java

示例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());
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:6,代码来源:FSTCPThrowableSerializer.java

示例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
}
 
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:5,代码来源:FSTStringBufferSerializer.java


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