CavalliumDBEngine/src/main/java/it/cavallium/dbengine/lucene/LongCodec.java

18 lines
385 B
Java
Raw Normal View History

2021-10-15 22:03:53 +02:00
package it.cavallium.dbengine.lucene;
2022-03-16 13:47:56 +01:00
import io.netty5.buffer.ByteBuf;
2021-10-15 22:03:53 +02:00
import java.util.function.Function;
public class LongCodec implements LMDBCodec<Long> {
@Override
public ByteBuf serialize(Function<Integer, ByteBuf> allocator, Long data) {
return allocator.apply(Long.BYTES).writeLong(data);
}
@Override
public Long deserialize(ByteBuf b) {
return b.readLong();
}
}