mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Implemented AgileBytesMarshaller for Integer
This commit is contained in:
@@ -94,6 +94,8 @@ final class SerializationBuilder<E> implements Cloneable {
|
||||
agileMarshaller((AgileBytesMarshaller<E>) LongMarshaller.INSTANCE, factory);
|
||||
} else if (eClass == Double.class) {
|
||||
agileMarshaller((AgileBytesMarshaller<E>) DoubleMarshaller.INSTANCE, factory);
|
||||
} else if (eClass == Integer.class) {
|
||||
agileMarshaller((AgileBytesMarshaller<E>) IntegerMarshaller.INSTANCE, factory);
|
||||
} else if (eClass == byte[].class) {
|
||||
reader((BytesReader<E>) ByteArrayMarshaller.INSTANCE, factory);
|
||||
interop((BytesInterop<E>) ByteArrayMarshaller.INSTANCE);
|
||||
@@ -113,8 +115,6 @@ final class SerializationBuilder<E> implements Cloneable {
|
||||
return new BytesMarshallableMarshaller(classForMarshaller);
|
||||
if (Externalizable.class.isAssignableFrom(eClass))
|
||||
return new ExternalizableMarshaller(classForMarshaller);
|
||||
if (eClass == Integer.class)
|
||||
return (BytesMarshaller<E>) IntegerMarshaller.INSTANCE;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -330,27 +330,6 @@ final class SerializationBuilder<E> implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
private enum IntegerMarshaller implements BytesMarshaller<Integer> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public void write(Bytes bytes, Integer v) {
|
||||
bytes.writeInt(v);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Integer read(Bytes bytes) {
|
||||
return bytes.readInt();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Integer read(Bytes bytes, @Nullable Integer v) {
|
||||
return bytes.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
private static class SerializableMarshaller implements BytesMarshaller {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user