def seek_contiguous_max(needle, step_lines = 10)

      file     = @file
      max      = nil

      # move to head of line
      seek_line_head

      loop do

        # file#pos before #forward_lines
        pos_old   = file.pos

        lines     = forward_lines(step_lines)
        lines_pos = lines.rindex(needle)

        # for debug
        # p [
        #       lines: lines,
        #   lines_pos: lines_pos,
        #    file_pos: file.pos
        #   ].to_s
        # sleep 0.05

        # if did not match needle
        # - returner is last set value to 'max'
        break if lines_pos.nil?

        lines_end_pos = str_byte_index(lines, /(\r\n|\r|\n)+?/, lines_pos)

        if lines_end_pos.nil?
          max = file.size if file.eof?
          break
        end

        max = pos_old + lines_end_pos

        # for debug
        # p [
        #           lines: lines,
        # lines_bytesize: lines.bytesize,
        #       lines_pos: lines_pos,
        #   lines_end_pos: lines_end_pos,
        #        file_pos: file.pos
        #   ].to_s
        # sleep 0.05

        break if file.eof?
        break if lines_end_pos < lines.size - 1
      end

      file.seek(max) unless max.nil?
      max
    end
def seek_contiguous_max(needle, step_lines = 10)

      file     = @file
      max      = nil

      # move to head of line
      seek_line_head

      loop do

        # file#pos before #forward_lines
        pos_old   = file.pos

        lines     = forward_lines(step_lines)
        lines_pos = lines.rindex(needle)

        # for debug
        # p [
        #       lines: lines,
        #   lines_pos: lines_pos,
        #    file_pos: file.pos
        #   ].to_s
        # sleep 0.05

        # if did not match needle
        # - returner is last set value to 'max'
        break if lines_pos.nil?

        lines_end_pos = str_byte_index(lines, /(\r\n|\r|\n)+?/, lines_pos)

        if lines_end_pos.nil?
          max = file.size if file.eof?
          break
        end

        max = pos_old + lines_end_pos

        # for debug
        # p [
        #           lines: lines,
        # lines_bytesize: lines.bytesize,
        #       lines_pos: lines_pos,
        #   lines_end_pos: lines_end_pos,
        #        file_pos: file.pos
        #   ].to_s
        # sleep 0.05

        break if file.eof?
        break if lines_end_pos < lines.size - 1
      end

      file.seek(max) unless max.nil?
      max
    end
scan max file#pos of contiguous.
 before set to be within contiguous range.

 args
   needle     ... RegExp or String object for contiguous check
   step_lines ... number of lines for #forward_lines

 returner
   Integer object for file#pos
   EOL of matched line