首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

//资料 流操作图片

2012-10-18 
//文件 流操作图片?//文件操作String path g:/iphone4.jpgFile file new File(path)?FileInputStr

//文件 流操作图片

?

//文件操作

String path = "g:/iphone4.jpg";

File file = new File(path);

?

FileInputStream fis = new FileInputStream(file);

byte[] b = new byte[fis.available()];

StringBuilder str = new StringBuilder();//不建议用String

?fis.read(b);

?

?

?

//把字节数组的图片写到另一个地方

?

? ?File apple= new File("D:/apple.jpg");

? ?FileOutputStream fos = new FileOutputStream(apple);

? ?fos.write(b);

? ?fos.flush();

?

//

热点排行