code: public static String getDirectMemoryStatsAsString(BufferPoolMXBean bufferPoolMxBean) {
  		if (bufferPoolMxBean == null) {
  			return "Direct memory stats: unavailable";
  		}
  		else {
  			return String.format("Direct memory stats: Count: %d, Total Capacity: %d, Used Memory: %d",
  					bufferPoolMxBean.getCount(),
  					bufferPoolMxBean.getTotalCapacity(),
  					bufferPoolMxBean.getMemoryUsed());
  		}
  	}
docs: Returns a String with the <strong>direct</strong> memory footprint.
  
  <p>These stats are not part of the other memory beans.
  
  @param bufferPoolMxBean The direct buffer pool bean or <code>null</code> if none available.
  
  @return A string with the count, total capacity, and used direct memory.