# File lib/openstack/swift/storage_object.rb, line 255
    def write(data, headers = {})
      server = @container.swift.connection.service_host
      path = @container.swift.connection.service_path + URI.encode("/#{@containername}/#{@name}")
      port = @container.swift.connection.service_port
      scheme = @container.swift.connection.service_scheme
      body = (data.is_a?(String))? StringIO.new(data) : data
      body.binmode if (body.respond_to?(:binmode))
      response = @container.swift.connection.put_object(server, path, port, scheme, headers, body, 0)
      raise OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
      true
    end