23 lines
544 B
Java
23 lines
544 B
Java
package com.psmreborn.pkgj;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
|
|
public class StrUtil {
|
|
public static void copyTo(InputStream inpStream, OutputStream outStream) throws IOException {
|
|
byte[] buffer = new byte[8192];
|
|
int totalRead = 0;
|
|
|
|
while(true){
|
|
totalRead = inpStream.read(buffer, 0, buffer.length);
|
|
if(totalRead == -1)
|
|
break;
|
|
outStream.write(buffer, 0, totalRead);
|
|
}
|
|
|
|
outStream.flush();
|
|
}
|
|
|
|
}
|