code: public static long length(DataBuffer buffer) {
          long ret = 1;
          val rr = buffer.asLong();
          DataBuffer shape = Shape.shapeOf(buffer);
          int rank = Shape.rank(buffer);
          for (int i = 0; i < rank; i++)
              ret *= shape.getLong(i);
  
          return ret;
      }
docs: Gets the rank given the shape info buffer
  @param buffer the buffer to get the rank for
  @return the rank for the shape buffer