// and write to this outputstream
//First handle the headers
InputStream in = source.getInputStream();
InternetHeaders headers = new InternetHeaders(in);
PrintWriter pos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
for (Enumeration e = headers.getNonMatchingHeaderLines(ignoreList); e.hasMoreElements(); ) {
String header = (String)e.nextElement();
pos.println(header);
}
pos.println();
// TODO: This is really a bad way to do this sort of thing. A shared buffer to
// allow simultaneous read/writes would be a substantial improvement
byte[] block = new byte[1024];
int read = 0;
while ((read = in.read(block)) > 0) {