Update Serializer.java and SerializerFixedBinaryLength.java
This commit is contained in:
parent
2bd69f0331
commit
a949fcd1de
@ -2,13 +2,13 @@ package it.cavallium.dbengine.database.collections;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
public interface Serializer<B> {
|
public interface Serializer<A, B> {
|
||||||
|
|
||||||
B deserialize(ByteBuf serialized);
|
A deserialize(B serialized);
|
||||||
|
|
||||||
void serialize(B deserialized, ByteBuf output);
|
void serialize(A deserialized, B output);
|
||||||
|
|
||||||
static Serializer<ByteBuf> noop() {
|
static Serializer<ByteBuf, ByteBuf> noop() {
|
||||||
return new Serializer<>() {
|
return new Serializer<>() {
|
||||||
@Override
|
@Override
|
||||||
public ByteBuf deserialize(ByteBuf serialized) {
|
public ByteBuf deserialize(ByteBuf serialized) {
|
||||||
@ -23,7 +23,7 @@ public interface Serializer<B> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializer<byte[]> noopBytes() {
|
static Serializer<byte[], ByteBuf> noopBytes() {
|
||||||
return new Serializer<>() {
|
return new Serializer<>() {
|
||||||
@Override
|
@Override
|
||||||
public byte[] deserialize(ByteBuf serialized) {
|
public byte[] deserialize(ByteBuf serialized) {
|
||||||
|
@ -2,11 +2,11 @@ package it.cavallium.dbengine.database.collections;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
public interface SerializerFixedBinaryLength<B> extends Serializer<B> {
|
public interface SerializerFixedBinaryLength<A, B> extends Serializer<A, B> {
|
||||||
|
|
||||||
int getSerializedBinaryLength();
|
int getSerializedBinaryLength();
|
||||||
|
|
||||||
static SerializerFixedBinaryLength<ByteBuf> noop(int length) {
|
static SerializerFixedBinaryLength<ByteBuf, ByteBuf> noop(int length) {
|
||||||
return new SerializerFixedBinaryLength<>() {
|
return new SerializerFixedBinaryLength<>() {
|
||||||
@Override
|
@Override
|
||||||
public ByteBuf deserialize(ByteBuf serialized) {
|
public ByteBuf deserialize(ByteBuf serialized) {
|
||||||
|
Loading…
Reference in New Issue
Block a user