file 转 byte
来源:互联网 发布:保定东方云网络优化 编辑:程序博客网 时间:2024/06/06 09:52
try {
File file=new File(path);
if(file!=null){
FileInputStream fis=new FileInputStream (file);
if(fis!=null){
int len=fis.available();
byte[] xml=new byte[len];
fis.read(xml); //现在file中的内容全读到了byte[]数组中
//如果文件中是文本信息那么: String str=new String(xml,"utf-8");就可以得到文字内容
}
}
} catch (Exception e) {
}
- File转byte[]
- file 转 byte
- byte[] to file or file to byte[]
- file和byte转换
- File和byte[]转换
- File,Byte[],InputStream convertion
- File和byte[]转换
- android File 转成 byte[]
- File和byte[]转换
- Image,File与Byte转换
- java File 与 byte[] 互转
- 字节转文件 byte-->file
- Reading a File into a Byte Array
- File,byte,Object之间的相互转化
- Java File,object,byte[]间转换
- byte数组和File,InputStream互转
- byte order form webrtc soure file
- java File和Byte[]数组 相互转换
- 三餐中的健美之计
- 外包项目的网站推荐
- Eclipse 自动生成 Ant的Build.xml 配置文件
- 设置SQL脚本自动输出日志
- Ajax中文乱码解决方案最终版-兼容IE和FF
- file 转 byte
- MATLAB神经网络工具箱中感知器权值和阈值的学习函数learnp
- python学习---4(python os模块)
- dtree实现动态加载树形菜单,动态插入树形菜单
- 【SQL 2005 异常之一解决方案】类别不支持集合(或类别对象为远程对象) (异常来自 HRESULT:0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.
- jquery获取select中的option的text值
- currentpoint in axes and figure matlab
- 有关K3HR系统人事事务提交失败的问题解决方法
- ubuntu启动流程及定制