code: @Override
    public void readExternal(ObjectInput in) throws IOException {
      int dim = in.readInt();
      min = new double[dim];
      max = new double[dim];
  
      for(int i = 0; i < min.length; i++) {
        min[i] = in.readDouble();
      }
  
      for(int i = 0; i < max.length; i++) {
        max[i] = in.readDouble();
      }
    }
docs: The object implements the readExternal method to restore its contents by
  calling the methods of DataInput for primitive types and readObject for
  objects, strings and arrays. The readExternal method must read the values
  in the same sequence and with the same types as were written by
  writeExternal.
  
  @param in the stream to read data from in order to restore the object
  @throws java.io.IOException if I/O errors occur