1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 数组如何转换成fileInputStream – PHP基础 – 前端 php手机头像保存失败

数组如何转换成fileInputStream – PHP基础 – 前端 php手机头像保存失败

时间:2020-02-24 23:35:31

相关推荐

数组如何转换成fileInputStream – PHP基础 – 前端 php手机头像保存失败

1、将File、fileInputStream 转换为byte数组:File file = new File(“file.txt”);InputStream input = new FileInputStream(file);byte[] byt = new byte[input.available()];input.read(byt);

2、将byte数组转换为InputStream:byte[] byt = new byte[1024];InputStream input = new ByteArrayInputStream(byt);

3、将byte数组转换为File:File file = new File(”);OutputStream output = new FileOutputStream(file);BufferedOutputStream bufferedOutput = new BufferedOutputStream(output);bufferedOutput.write(byt);

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。