public static String toHexString(ByteBuffer buf,String sep,int lineLen){
  return toHexString(buf.array(),buf.arrayOffset() + buf.position(),buf.remaining(),sep,lineLen);
}

public static String toHexString ( ByteBuffer buf , String sep , int lineLen ) { return toHexString ( buf . array ( ) , buf . arrayOffset ( ) + buf . position ( ) , buf . remaining ( ) , sep , lineLen ) ; }
get a text representation of a bytebuffer as hexadecimal string , where each pair of hexadecimal digits corresponds to consecutive bytes in the array .
