}
/** Write the current MultipartHeader to the buffer.
*/
private void writeHeader () {
MultipartHeader h =
new MultipartHeader (Header.CRLF + "--" + separator);
Range r = ranges.get (currentRange);
if (contentType != null)
h.setHeader ("Content-Type", contentType);
h.setHeader ("Content-Range", "bytes " + r.getStart () + "-" +
r.getEnd () + "/" + totalSize);
buffer.put (h.toString ().getBytes ());
}