DataExternalizer<PlusOffsets> () { return new DataExternalizer<>() { @Override public void save(@NotNull DataOutput out, PlusOffsets value) throws IOException { int[] offsets = value.getOffsets(); DataInputOutputUtil.writeINT(out, offsets.length); for (int i : offsets) { DataInputOutputUtil.writeINT(out, i); } } @Override public PlusOffsets read(@NotNull DataInput in) throws IOException { int[] result = new int[DataInputOutputUtil.readINT(in)]; for (int i = 0; i < result.length; i++) { result[i] = DataInputOutputUtil.readINT(in); } return new PlusOffsets(result); } }; }