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


Java Output.writeBoolean方法代碼示例

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


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

示例1: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, BSpline bSpline) {
    Class<? extends Vector> vectorType = null;
    if (bSpline.controlPoints != null && bSpline.controlPoints.length > 0)
        vectorType = bSpline.controlPoints[0].getClass();
    else if (bSpline.knots != null && bSpline.knots.size > 0)
        vectorType = ((Vector)bSpline.knots.first()).getClass();
    kryo.writeClass(output, vectorType);
    output.writeInt(bSpline.controlPoints != null ? bSpline.controlPoints.length : -1); // -1 for null array
    if (bSpline.controlPoints != null){
        for (int i = 0; i < bSpline.controlPoints.length; i++) {
            kryo.writeObjectOrNull(output, bSpline.controlPoints[i], vectorType);
        }
    }
    kryo.writeObjectOrNull(output, bSpline.knots, Array.class);
    output.writeInt(bSpline.degree, true);
    output.writeBoolean(bSpline.continuous);
    output.writeInt(bSpline.spanCount, true);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:20,代碼來源:BSplineSerializer.java

示例2: write

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

    Serializer keySerializer = null;
    if (keyGenericType != null) {
        if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
        keyGenericType = null;
    }

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

示例3: 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

示例4: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IntMap map) {
    int length = map.size;
    output.writeVarInt(length, true);
    output.writeBoolean(false); // whether type is written (in case future version of IntMap 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();) {
        IntMap.Entry entry = (IntMap.Entry)iter.next();
        output.writeInt(entry.key);
        if (valueSerializer != null) {
            kryo.writeObjectOrNull(output, entry.value, valueSerializer);
        } else
            kryo.writeClassAndObject(output, entry.value);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:20,代碼來源:IntMapSerializer.java

示例5: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public final void write (Kryo kryo, Output output) {
    if (currentReadWriteVersion == -1)
        throw new RuntimeException("currentReadWriteVersion must be set before writing.");
    if (currentReadWriteVersion < 0 || minimumReadVersion < 0)
        throw new RuntimeException("currentReadWriteVersion and minimumReadVersion must not be less than 0.");
    if (currentReadWriteVersion < minimumReadVersion)
        throw new RuntimeException("currentReadWriteVersion cannot be lower than minimumReadVersion");

    Class type = data == null ? null : data.getClass();
    pushHeader(kryo, this);
    output.writeInt(GRAPH_HEADER_VERSION, true);
    kryo.writeClass(output, type);
    output.writeInt(Version.MAJOR, true);
    output.writeInt(Version.MINOR, true);
    output.writeInt(Version.REVISION, true);
    output.writeInt(currentReadWriteVersion, true);
    output.writeInt(minimumReadVersion, true);
    output.writeString(minimumReadVersionString);
    output.writeBoolean(useCompactColor);
    output.writeBoolean(includePixmapDrawingParams);
    writeExtra(kryo, output);
    if (data != null)
        kryo.writeObject(output, data);
    popHeader(kryo);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:27,代碼來源:GraphHeader.java

示例6: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, CatmullRomSpline catmullRomSpline) {
    Class<? extends Vector> vectorType = null;
    if (catmullRomSpline.controlPoints != null && catmullRomSpline.controlPoints.length > 0)
        vectorType = catmullRomSpline.controlPoints[0].getClass();
    kryo.writeClass(output, vectorType);
    output.writeInt(catmullRomSpline.controlPoints != null ? catmullRomSpline.controlPoints.length : -1); // -1 for null array
    if (catmullRomSpline.controlPoints != null){
        for (int i = 0; i < catmullRomSpline.controlPoints.length; i++) {
            kryo.writeObjectOrNull(output, catmullRomSpline.controlPoints[i], vectorType);
        }
    }
    output.writeBoolean(catmullRomSpline.continuous);
    output.writeInt(catmullRomSpline.spanCount, true);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:16,代碼來源:CatmullRomSplineSerializer.java

示例7: write

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

示例8: write

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

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

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

示例9: write

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

示例10: 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

示例11: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ArrayMap map) {
    output.writeBoolean(map.ordered);
    int length = map.size;
    output.writeVarInt(length, true);
    kryo.writeClass(output, map.keys.getClass().getComponentType());
    kryo.writeClass(output, map.values.getClass().getComponentType());

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

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

示例12: write

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

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

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

示例13: write

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

示例14: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Summary object) {
    output.writeInt(object.value.length);
    for (int i = 0; i < object.value.length; i++) {
        output.writeFloat(object.value[i]);
    }

    output.writeInt(object.rmin.length);
    for (int i = 0; i < object.rmin.length; i++) {
        output.writeDouble(object.rmin[i]);
    }

    output.writeInt(object.rmax.length);
    for (int i = 0; i < object.rmax.length; i++) {
        output.writeDouble(object.rmax[i]);
    }

    output.writeInt(object.w.length);
    for (int i = 0; i < object.w.length; i++) {
        output.writeFloat(object.w[i]);
    }

    output.writeInt(object.capacity);
    output.writeInt(object.cursor);
    output.writeDouble(object.B);
    output.writeBoolean(object.exact);
    output.writeDouble(object.eps);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:29,代碼來源:WeightApproximateQuantile.java

示例15: write

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


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