response.addHeader(CONTENT_RANGE_HEADER, "bytes "
+ rangeText.substring(1) + "/" + res.length());
response.setContentLength(totalSent);
response.addHeader(ACCEPT_RANGES_HEADER, "bytes");
response.addDateHeader(LAST_MODIFIED_DATE_HEADER, res
.lastModified());
OutputStream out = response.getOutputStream();
int bytesRead = 0;
for (Iterator i = ranges.iterator(); i.hasNext();) {
String rangeBlock = (String) i.next();