Optimization
This commit is contained in:
parent
ff703453f8
commit
703e92cc8f
@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
public interface DataSerializer<T> {
|
public interface DataSerializer<T> {
|
||||||
|
|
||||||
void serialize(DataOutput dataOutput, @Nullable T data) throws IOException;
|
void serialize(DataOutput dataOutput, @NotNull T data) throws IOException;
|
||||||
|
|
||||||
@NotNull T deserialize(DataInput dataInput) throws IOException;
|
@NotNull T deserialize(DataInput dataInput) throws IOException;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ public class ArrayInt52Serializer implements DataSerializer< List<Int52>> {
|
|||||||
@Override
|
@Override
|
||||||
public void serialize(DataOutput dataOutput, List<Int52> data) throws IOException {
|
public void serialize(DataOutput dataOutput, List<Int52> data) throws IOException {
|
||||||
dataOutput.writeInt(data.size());
|
dataOutput.writeInt(data.size());
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (Int52 datum : data) {
|
||||||
Int52Serializer.INSTANCE.serialize(dataOutput, data.get(i));
|
Int52Serializer.INSTANCE.serialize(dataOutput, datum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user