code: protected void writeHeaders(HttpServletResponse response, Resource resource, long count) throws IOException
      {
          ResourceCache.ResourceMetaData metaData = _httpContext.getResourceMetaData(resource);
  
          response.setContentType(metaData.getMimeType());
          if (count != -1)
          {
              if (count == resource.length() && response instanceof ServletHttpResponse )
                  response.setHeader(HttpFields.__ContentLength, metaData.getLength());
              else
                  response.setContentLength((int) count);
          }
  
          response.setHeader(HttpFields.__LastModified, metaData.getLastModified());
  
          if (_acceptRanges)
              response.setHeader(HttpFields.__AcceptRanges, "bytes");
      }
docs: /* ------------------------------------------------------------