Optimization

This commit is contained in:
Andrea Cavalli 2021-09-23 12:02:07 +02:00
parent ff703453f8
commit 703e92cc8f
2 changed files with 3 additions and 3 deletions

View File

@ -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;
} }

View File

@ -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);
} }
} }