一、输入流(读)
File file = new FIle(String path);
InputStream is = new FileInputStream(file);
FileOutputStream os = null;
os = new FileOutputStream(outfile);
byte[] b = new byte[1024];
int c;
String result="";
BASE64Encoder encoder = new BASE64Encoder();
/* //对输入流加密
while((c=is.read(b))!=-1){
result += encoder.encoder(b);
}
return result;
*/
while((c=is.read(b))!=-1){
os.write(b, 0, c);
}
if(is !=null){
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(os!=null){
try {
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}