def dump(data,output=$stdout)
      unless output.respond_to?(:<<)
        raise(ArgumentError,"output must support the #<< method")
      end

      bytes_segment_width = ((@width * @format_width) + @width)
      line_format = "%.8x  %-#{bytes_segment_width}s |%s|\n"

      index = 0
      count = 0

      numeric   = ''
      printable = ''

      each_word(data) do |word|
        numeric   << format_numeric(word) << ' '
        printable << format_printable(word)

        count += 1

        if count >= @width
          output << sprintf(line_format,index,numeric,printable)

          numeric   = ''
          printable = ''

          index += (@width * @word_size)
          count  = 0
        end
      end

      if count > 0
        # output the remaining line
        output << sprintf(line_format,index,numeric,printable)
      end
    end
def dump(data,output=$stdout)
      unless output.respond_to?(:<<)
        raise(ArgumentError,"output must support the #<< method")
      end

      bytes_segment_width = ((@width * @format_width) + @width)
      line_format = "%.8x  %-#{bytes_segment_width}s |%s|\n"

      index = 0
      count = 0

      numeric   = ''
      printable = ''

      each_word(data) do |word|
        numeric   << format_numeric(word) << ' '
        printable << format_printable(word)

        count += 1

        if count >= @width
          output << sprintf(line_format,index,numeric,printable)

          numeric   = ''
          printable = ''

          index += (@width * @word_size)
          count  = 0
        end
      end

      if count > 0
        # output the remaining line
        output << sprintf(line_format,index,numeric,printable)
      end
    end
Dumps the hexdump.

 @param [#each_byte] data
   The data to be hexdumped.

 @param [#<<] output
   The output to dump the hexdump to.

 @return [nil]

 @raise [ArgumentError]
   The output value does not support the `#<<` method.

 @since 0.2.0