org.mapdb.serializer.SerializerBigInteger 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.DataInput2;
import org.mapdb.DataOutput2;
import org.mapdb.Serializer;
import java.io.IOException;
import java.math.BigInteger;
/**
* Created by jan on 2/28/16.
*/
public class SerializerBigInteger extends GroupSerializerObjectArray {
@Override
public void serialize(DataOutput2 out, BigInteger value) throws IOException {
BYTE_ARRAY.serialize(out, value.toByteArray());
}
@Override
public BigInteger deserialize(DataInput2 in, int available) throws IOException {
return new BigInteger(BYTE_ARRAY.deserialize(in, available));
}
@Override
public boolean isTrusted() {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy