code: public static String bufferToString(IntBuffer buffer) {
          StringBuilder builder = new StringBuilder();
          int rank = buffer.get(0);
          builder.append("[ ").append(rank).append(", ");
          for (int p = 1; p < rank * 2 + 4; p++) {
              builder.append(buffer.get(p));
              if (p < rank * 2 + 4 - 1)
                  builder.append(", ");
          }
          builder.append("]");
          return builder.toString();
      }
docs: Prints the {@link IntBuffer}
  @param buffer the buffer to print
  @return the to string for the buffer