當前位置: 首頁>>代碼示例>>Java>>正文


Java Output.writeLong方法代碼示例

本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeLong方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeLong方法的具體用法?Java Output.writeLong怎麽用?Java Output.writeLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.esotericsoftware.kryo.io.Output的用法示例。


在下文中一共展示了Output.writeLong方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, LongMap map) {
    int length = map.size;
    output.writeVarInt(length, true);
    output.writeBoolean(false); // whether type is written (in case future version of LongMap supports type awareness)

    Serializer valueSerializer = null;
    if (valueGenericType != null) {
        if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueGenericType);
        valueGenericType = null;
    }

    for (Iterator iter = map.iterator(); iter.hasNext();) {
        LongMap.Entry entry = (LongMap.Entry)iter.next();
        output.writeLong(entry.key);
        if (valueSerializer != null) {
            kryo.writeObjectOrNull(output, entry.value, valueSerializer);
        } else
            kryo.writeClassAndObject(output, entry.value);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:21,代碼來源:LongMapSerializer.java

示例2: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, ArrayMetaData<long[]> object) {
    try {
        long[] arrData = arrayMetaData.getArrData();
        arrayMetaData.send(output);
        int arrSegNum = arrayMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = arrayMetaData.getFrom(i);
            int to = arrayMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                output.writeLong(arrData[j]);
            }
        }
    } catch (IOException e) {
        LOG.error("double array write exception", e);
        System.exit(1);
    }
}
 
開發者ID:yuantiku,項目名稱:ytk-mp4j,代碼行數:18,代碼來源:LongOperand.java

示例3: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, LongArray array) {
    output.writeVarInt(array.size, true);
    output.writeBoolean(array.ordered);
    for (int i = 0; i < array.size; i++) {
        output.writeLong(array.get(i));
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:9,代碼來源:LongArraySerializer.java

示例4: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, DefaultPort object) {
    kryo.writeClassAndObject(output, object.element());
    kryo.writeObject(output, object.number());
    output.writeBoolean(object.isEnabled());
    kryo.writeObject(output, object.type());
    output.writeLong(object.portSpeed());
    kryo.writeClassAndObject(output, object.annotations());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:10,代碼來源:DefaultPortSerializer.java

示例5: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, PortNumber object) {
    output.writeBoolean(object.hasName());
    output.writeLong(object.toLong());
    if (object.hasName()) {
        output.writeString(object.name());
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:9,代碼來源:PortNumberSerializer.java

示例6: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, RandomXS128 random) {
    output.writeLong(random.getState(0));
    output.writeLong(random.getState(1));
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:6,代碼來源:RandomXS128Serializer.java

示例7: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, MastershipBasedTimestamp object) {
    output.writeLong(object.termNumber());
    output.writeLong(object.sequenceNumber());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:6,代碼來源:MastershipBasedTimestampSerializer.java

示例8: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, MastershipTerm object) {
    kryo.writeClassAndObject(output, object.master());
    output.writeLong(object.termNumber());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:6,代碼來源:MastershipTermSerializer.java

示例9: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, HostLocation object) {
    kryo.writeClassAndObject(output, object.deviceId());
    kryo.writeClassAndObject(output, object.port());
    output.writeLong(object.time());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:7,代碼來源:HostLocationSerializer.java


注:本文中的com.esotericsoftware.kryo.io.Output.writeLong方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。