FileInputStream
fis
=
null
;
FileOutputStream
fos
=
null
;
try
{
fis
=
new
FileInputStream(
headPhoto
);
fos
=
new
FileOutputStream(
new
File(
forder
,
"图片名.png"
));
byte
[]
buffer
=
new
byte
[4096];
int
length
= 0;
while
( (
length
=
fis
.read(
buffer
))>0 ){
fos
.write(
buffer
, 0,
length
);
}
}
catch
(Exception
e
){
e
.printStackTrace();
}
finally
{
if
(
fis
!=
null
){
try
{
fis
.close();
}
catch
(Exception
e
){}
}
if
(
fos
!=
null
){
try
{
fos
.close();
}
catch
(Exception
e
){}
}
}