def write(buffer)
      bytes_parsed = @parser.write(buffer)
      if bytes_parsed != buffer.size
        msg = "Parser error, #{bytes_parsed} of #{buffer.length} bytes parsed"
        @on_error.call(msg) unless @on_error.nil?
      end
    end
def write(buffer)
      bytes_parsed = @parser.write(buffer)
      if bytes_parsed != buffer.size
        msg = "Parser error, #{bytes_parsed} of #{buffer.length} bytes parsed"
        @on_error.call(msg) unless @on_error.nil?
      end
    end
Write data from the given buffer (String)
 into the reader.