读取本地文件上传
来源:互联网 发布:乐乎pt ipv4 编辑:程序博客网 时间:2024/06/05 22:35
Java读取本地一个文件,上传到本地另一个地方
package test;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;public class myTest { public static void main(String[] args) throws IOException { String loadPath = "E:/timg.jpg", outPath = "D:/uplode.jpg"; InputStream in = new FileInputStream(new File(loadPath)); FileOutputStream out = new FileOutputStream(new File(outPath)); byte[] buffer = new byte[100];// 缓存大小 int readNumber = 0; while ((readNumber = in.read(buffer)) != -1) { out.write(buffer, 0, readNumber);// 读取并输出buffer数组里面0~n个字节 } in.close(); out.close(); }}
阅读全文
0 0
- 读取本地文件上传
- 读取本地文件上传到数据库
- html5读取本地文件 图片上传 示例代码
- 读取本地文件
- 读取本地文件
- 读取本地文件
- 本地文件上传
- winForm读取本地文件并且上传到服务器(非FTP)
- 读取json 读取本地文件
- MSSQL 读取本地文件数据
- JAVASCRIPT 读取本地文件
- js读取本地文件
- js读取本地文件
- Flex 实现读取本地文件
- flex实现读取本地文件
- AIR读取本地文件
- MSSQL 读取本地文件数据
- Flash:flash 读取本地文件
- android studio 3.0 -Aapt2Exception
- Windows环境下Hadoop开发环境配置
- 数据分析模块pandas
- 统计分析模块statistics
- 使用两种方式登录Oracle数据库
- 读取本地文件上传
- 细节问题之ScrollView自动回滚到顶部
- Oracle的用户
- VC++实现微秒级的精确定时器
- 速微生活小程序开发分析
- Oracle的表空间
- 创建、修改、删除Oracle表空间
- Qt 实现多级菜单
- 认识Oracle表