code: static private StringBuilder formatHexData(StringBuilder buffer, byte[] data, int inOffset) {
          int offset = inOffset;
          int end = offset + 8;
          if (offset >= data.length) {
              // have nothing, just print empty chars
              buffer.append("                       ");
              return buffer;
          }
          buffer.append(convertHex((0xff & data[offset]) / 16));
          buffer.append(convertHex((0xff & data[offset]) % 16));
          for (++offset; offset < end; offset++) {
              if (offset >= data.length) {
                  buffer.append("   ");
                  continue;
              }
              buffer.append(' ');
              buffer.append(convertHex((0xff & data[offset]) / 16));
              buffer.append(convertHex((0xff & data[offset]) % 16));
          }
  
          return buffer;
      }
docs: Format the next 8 bytes of the input data starting from the offset as
  2 digit hex characters.
  
  @param buffer
  @param data
  @param inOffset
  @return StringBuilder