18 lines
383 B
Java
18 lines
383 B
Java
|
package it.cavallium.dbengine.lucene;
|
||
|
|
||
|
import io.net5.buffer.ByteBuf;
|
||
|
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();
|
||
|
}
|
||
|
}
|