code: public static Integer getCoordinateDimension(byte[] geom) throws IOException {
          if (geom == null) {
              return null;
          }
          return GeometryMetaData.getMetaDataFromWKB(geom).dimension;
      }
docs: Returns the dimension of the coordinates of the given geometry.
  
  @param geom Geometry
  @return The dimension of the coordinates of the given geometry
  @throws IOException