'Set the Content-length and Content-type headers for this request.
This method is not appropriate for requests for multiple byte ranges;
L{_doMultipleRangeRequest} will set these headers in that case.
@param request: The L{twisted.web.http.Request} object.
@param size: The size of the response.  If not specified, default to
C{self.getFileSize()}.'

def _setContentHeaders(self, request, size=None):

    if (size is None):
        size = self.getFileSize()
    request.setHeader('content-length', intToBytes(size))
    if self.type:
        request.setHeader('content-type', networkString(self.type))
    if self.encoding:
        request.setHeader('content-encoding', networkString(self.encoding))
