public static void writeBytesToFile() throws IOException{
String s = "aaaaaaaa";
byte[] bs= s.getBytes();
OutputStream out = new FileOutputStream("/storage/sdcard0/aaa");
InputStream is = new ByteArrayInputStream(bs);
byte[] buff = new byte[1024];
int len = 0;
while((len=is.read(buff))!=-1){
out.write(buff, 0, len);
}
is.close();
out.close();
}
将byte数组写入文件
猜你喜欢
转载自blog.csdn.net/xifei66/article/details/54375483
今日推荐
周排行