class BigIntegerType extends StorageDataTypeBase {

    @Override
    public int getType() {
        return TYPE_BIG_INTEGER;
    }

    @Override
    public int compare(Object aObj, Object bObj) {
        BigInteger a = (BigInteger) aObj;
        BigInteger b = (BigInteger) bObj;
        return a.compareTo(b);
    }

    @Override
    public int getMemory(Object obj) {
        return 100;
    }

    @Override
    public void write(DataBuffer buff, Object obj) {
        BigInteger x = (BigInteger) obj;
        if (BigInteger.ZERO.equals(x)) {
            buff.put((byte) TAG_BIG_INTEGER_0);
        } else if (BigInteger.ONE.equals(x)) {
            buff.put((byte) TAG_BIG_INTEGER_1);
        } else {
            int bits = x.bitLength();
            if (bits <= 63) {
                buff.put((byte) TAG_BIG_INTEGER_SMALL).putVarLong(x.longValue());
            } else {
                byte[] bytes = x.toByteArray();
                buff.put((byte) TYPE_BIG_INTEGER).putVarInt(bytes.length).put(bytes);
            }
        }
    }

    @Override
    public Object read(ByteBuffer buff, int tag) {<FILL_FUNCTION_BODY>}
}

        switch (tag) {
        case TAG_BIG_INTEGER_0:
            return BigInteger.ZERO;
        case TAG_BIG_INTEGER_1:
            return BigInteger.ONE;
        case TAG_BIG_INTEGER_SMALL:
            return BigInteger.valueOf(DataUtils.readVarLong(buff));
        }
        int len = DataUtils.readVarInt(buff);
        byte[] bytes = DataUtils.newBytes(len);
        buff.get(bytes);
        return new BigInteger(bytes);
    
<methods>public non-sealed void <init>() ,public abstract int getType() ,public java.lang.Object read(java.nio.ByteBuffer) ,public java.lang.Object read(java.nio.ByteBuffer, int) ,public com.lealone.db.value.Value readValue(java.nio.ByteBuffer) ,public com.lealone.db.value.Value readValue(java.nio.ByteBuffer, int) ,public void writeValue(com.lealone.db.DataBuffer, com.lealone.db.value.Value) <variables>