code: public static long[] shape(IntBuffer buffer) {
          val ret = new long[rank(buffer)];
          for (int i = 0; i < ret.length; i++)
              ret[i] = buffer.get(1 + i);
          return ret;
      }
docs: Get array shape from the buffer, as an int[]
  @param buffer    Buffer to get the shape from
  @return          Shape array