def METHOD_NAME(self, length):
    if self.write_callable.num_writes == 0:
        self.content_length = length
        self.http_resp.setContentLength(length)
    else:
        raise ResponseCommitted("Cannot set content-length: response is already commited.")