public static String toStringBinary(ByteBuffer buf){
  if (buf == null)   return "null";
  if (buf.hasArray()) {
    return toStringBinary(buf.array(),buf.arrayOffset(),buf.limit());
  }
  return toStringBinary(toBytes(buf));
}

public static String toStringBinary ( ByteBuffer buf ) { if ( buf == null ) return "null" ; if ( buf . hasArray ( ) ) { return toStringBinary ( buf . array ( ) , buf . arrayOffset ( ) , buf . limit ( ) ) ; } return toStringBinary ( toBytes ( buf ) ) ; }
converts the given byte buffer to a printable representation , from the index 0 ( inclusive ) to the limit ( exclusive ) , regardless of the current position . the position and the other index parameters are not changed .
