code: public static String byteBufferToString(ByteBuffer buf) {
      StringBuilder sb = new StringBuilder();
      for (int k = 0; k < buf.limit() / 4; k++) {
        if (k != 0) {
          sb.append(" ");
        }
        sb.append(buf.getInt());
      }
      return sb.toString();
    }
docs: Parses a {@link ByteBuffer} into a {@link String}. In particular, the function prints the
  content of the buffer in 4-byte increments as space separated integers.
  
  @param buf buffer to use
  @return the String representation of the {@link ByteBuffer}