code: private CoordinateSequence parseCS(ValueGetter data, boolean haveZ, boolean haveM) {
          int count = data.getInt();
          int dims = haveZ ? 3 : 2;
          CoordinateSequence cs = new Double(count, dims);
  
          for(int i = 0; i < count; ++i) {
              for(int d = 0; d < dims; ++d) {
                  cs.setOrdinate(i, d, data.getDouble());
              }
  
              if (haveM) {
                  data.getDouble();
              }
          }
  
          return cs;
      }
docs: Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
  {@link org.locationtech.jts.geom.CoordinateSequence}.
  
  @param data {@link org.postgis.binary.ValueGetter} to parse.
  @param haveZ True if the {@link org.locationtech.jts.geom.CoordinateSequence} has a Z component.
  @param haveM True if the {@link org.locationtech.jts.geom.CoordinateSequence} has a M component.
  
  @return The parsed {@link org.locationtech.jts.geom.CoordinateSequence}.