Java 类com.badlogic.gdx.utils.LongArray 实例源码

项目:gdx-cclibs    文件:LongArraySerializer.java   
@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));
    }
}
项目:gdx-cclibs    文件:LongArraySerializer.java   
@Override
public LongArray read(Kryo kryo, Input input, Class<LongArray> type) {
    int length = input.readVarInt(true);
    boolean ordered = input.readBoolean();
    LongArray array = new LongArray(ordered, length);
    for (int i = 0; i < length; i++) {
        array.add(input.readLong());
    }
    return array;
}
项目:shadow-engine    文件:IntLongMap.java   
/** Returns a new array containing the remaining values. */
public LongArray toArray () {
    LongArray array = new LongArray(true, map.size);
    while (hasNext)
        array.add(next());
    return array;
}
项目:shadow-engine    文件:LongIntMap.java   
/** Returns a new array containing the remaining keys. */
public LongArray toArray () {
    LongArray array = new LongArray(true, map.size);
    while (hasNext)
        array.add(next());
    return array;
}