InputStream 转为 Byte
来源:互联网 发布:mac xquartz怎么用 编辑:程序博客网 时间:2024/05/21 08:41
public class Utils { public static byte[] getBytes(InputStream is) throws IOException { int len; int size = 1024; byte[] buf; if (is instanceof ByteArrayInputStream) { size = is.available(); buf = new byte[size]; len = is.read(buf, 0, size); } else { ByteArrayOutputStream bos = new ByteArrayOutputStream(); buf = new byte[size]; while ((len = is.read(buf, 0, size)) != -1) bos.write(buf, 0, len); buf = bos.toByteArray(); } return buf; }}
0 0
- InputStream 转为 Byte
- InputStream 转为byte[]字节数组
- JAVA中 byte[]数组如何转为InputStream
- byte---》InputStream
- byte[],InputStream
- 将OutputStream转为InputStream
- InputStream to Byte[]
- Blob、InputStream、byte 互转
- InputStream、byte[]互转
- InputStream 和 byte[] 互转
- InputStream、byte[]互转
- InputStream、byte[]互转
- inputstream 转 byte
- Blob、InputStream、byte 互转
- InputStream转byte[]
- byte[]转换成InputStream
- InputStream、byte[]互转
- InputStream转换成byte[]
- iOS单例
- Java内存管理原理及内存区域详解
- MySQL数据库的分区表、存储过程、event定时任务的创建
- NSString基础知识
- Freemarker遍历键值为对象的map
- InputStream 转为 Byte
- Android APK反编译详解(附图)
- xcode在真机调试的时候出现"The identity used to sign the executable is no longer valid"
- centos 7.0安装kvm
- 提交本地项目到github和提交更新
- Linux 6.4 网卡 not active 解决
- JS操作JSON总结
- java的类加载器详解
- 【window10下notepad++编辑器安装与配置C和C++(支持C++primer)】