org.mapdb.serializer.SerializerRecidArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mapdb Show documentation
Show all versions of mapdb Show documentation
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap memory. It is a fast, scalable and easy to use embedded Java database.
package org.mapdb.serializer;
import org.mapdb.DataIO;
import org.mapdb.DataInput2;
import org.mapdb.DataOutput2;
import java.io.IOException;
/**
* Created by jan on 2/28/16.
*/
public class SerializerRecidArray extends SerializerLongArray{
@Override
public void serialize(DataOutput2 out, long[] value) throws IOException {
out.packInt(value.length);
for (long recid : value) {
DataIO.packRecid(out, recid);
}
}
@Override
public long[] deserialize(DataInput2 in, int available) throws IOException {
int size = in.unpackInt();
long[] ret = new long[size];
for (int i = 0; i < size; i++) {
ret[i] = DataIO.unpackRecid(in);
}
return ret;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy