public static void copy(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[1024];
int len = 0;
while ((len = in.read(buf, 0, buf.length)) != -1) {
out.write(buf, 0, len);
}
}
public static void copy(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[1024];
int len = 0;
while ((len = in.read(buf, 0, buf.length)) != -1) {
out.write(buf, 0, len);
}
}