1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/* * @param ips 输入流 * @param ops 输出流 * @param closeStream 是否关闭流 * @throws Exception */ private static void copyStream(InputStream ips,OutputStream ops, boolean closeStream) throws Exception {
byte [] buf = new byte [ 1024 ];
int len = ips.read(buf);
while (len != - 1 ) {
ops.write(buf, 0 ,len);
len = ips.read(buf); } } |
本文转自arac 51CTO博客,原文链接:http://blog.51cto.com/skyarac/1341496,如需转载请自行联系原作者