ResponseUtilpublic final class ResponseUtil extends Object
Methods Summary |
---|
public static java.io.IOException | copy(java.io.InputStream istream, javax.servlet.ServletOutputStream ostream)Copies the contents of the specified input stream to the specified
output stream.
IOException exception = null;
byte buffer[] = new byte[2048];
int len = buffer.length;
while (true) {
try {
len = istream.read(buffer);
if (len == -1)
break;
ostream.write(buffer, 0, len);
} catch (IOException e) {
exception = e;
len = -1;
break;
}
}
return exception;
| public static java.io.IOException | copy(java.io.Reader reader, java.io.PrintWriter writer)Copies the contents of the specified input stream to the specified
output stream.
IOException exception = null;
char buffer[] = new char[2048];
int len = buffer.length;
while (true) {
try {
len = reader.read(buffer);
if (len == -1)
break;
writer.write(buffer, 0, len);
} catch (IOException e) {
exception = e;
len = -1;
break;
}
}
return exception;
|
|