2021-10-15 22:03:53 +02:00
|
|
|
package it.cavallium.dbengine.lucene;
|
|
|
|
|
2022-04-06 02:41:32 +02:00
|
|
|
import io.netty5.buffer.api.Buffer;
|
2021-10-15 22:03:53 +02:00
|
|
|
import java.util.function.Function;
|
|
|
|
|
2022-04-06 02:41:32 +02:00
|
|
|
public class LongCodec implements HugePqCodec<Long> {
|
2021-10-15 22:03:53 +02:00
|
|
|
|
|
|
|
@Override
|
2022-04-06 02:41:32 +02:00
|
|
|
public Buffer serialize(Function<Integer, Buffer> allocator, Long data) {
|
2021-10-15 22:03:53 +02:00
|
|
|
return allocator.apply(Long.BYTES).writeLong(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-04-06 02:41:32 +02:00
|
|
|
public Long deserialize(Buffer b) {
|
2021-10-15 22:03:53 +02:00
|
|
|
return b.readLong();
|
|
|
|
}
|
2022-04-06 02:41:32 +02:00
|
|
|
|
2021-10-15 22:03:53 +02:00
|
|
|
}
|