public String toHexString(final int start,final int length){
  final int roundedStart=(start / LOG_BYTES_PER_ROW) * LOG_BYTES_PER_ROW;
  final StringBuilder sb=new StringBuilder("buffer byte dump\n");
  int index=roundedStart;
  for (int nLogged=0; nLogged < length; nLogged+=LOG_BYTES_PER_ROW) {
    sb.append(String.format(" [%05d-%05d]",index,index + LOG_BYTES_PER_ROW - 1));
    for (int i=0; i < LOG_BYTES_PER_ROW; ++i) {
      try {
        final byte b=getByte(index++);
        sb.append(String.format(" 0x%02x",b));
      }
 catch (      IndexOutOfBoundsException ioob) {
        sb.append(" <ioob>");
      }
    }
    sb.append('\n');
  }
  return sb.toString();
}

public String toHexString ( final int start , final int length ) { final int roundedStart = ( start / LOG_BYTES_PER_ROW ) * LOG_BYTES_PER_ROW ; final StringBuilder sb = new StringBuilder ( "buffer byte dump\n" ) ; int index = roundedStart ; for ( int nLogged = 0 ; nLogged < length ; nLogged += LOG_BYTES_PER_ROW ) { sb . append ( String . format ( " [%05d-%05d]" , index , index + LOG_BYTES_PER_ROW - 1 ) ) ; for ( int i = 0 ; i < LOG_BYTES_PER_ROW ; ++ i ) { try { final byte b = getByte ( index ++ ) ; sb . append ( String . format ( " 0x%02x" , b ) ) ; } catch ( IndexOutOfBoundsException ioob ) { sb . append ( " <ioob>" ) ; } } sb . append ( '\n' ) ; } return sb . toString ( ) ; }
return the buffer ' s byte contents in the form of a hex dump .
