@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)); } }
@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; }
/** 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; }
/** 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; }