Method: HTML5::EncodingBytes#jump_to

Defined in:
lib/html5/inputstream.rb

#jump_to(bytes) ⇒ Object

Look for the next sequence of bytes matching a given sequence. If a match is found advance the position to the last byte of the match



459
460
461
462
463
464
465
466
467
# File 'lib/html5/inputstream.rb', line 459

def jump_to(bytes)
  new_position = self[position .. -1].index(bytes)
  if new_position
    @position += (new_position + bytes.length-1)
    return true
  else
    raise EOF
  end
end