185_08_IO流_FileInputStream_05_byte数组转换成字符串
2017-04-30 17:53
309 查看
package TestIO; import java.io.*; public class Test01 { public static void main(String[] args) throws Exception { ////内容是:abcdefg String filepath= "C:/中国电视台直播源.txt"; //创建流 FileInputStream fis= new FileInputStream(filepath); //创建数组 byte[] bytes = new byte[1024]; // while(true){ // int temp = fis.read(bytes); // if(temp==-1) break; // System.out.println(new String(bytes,0,temp)); // } //升级循环 int temp = 0; while((temp = fis.read(bytes)) != -1){ System.out.print(new String(bytes,0,temp)); } fis.close(); } }
相关文章推荐
- 183_08_IO流_FileInputStream_03_读取到内存的byte数组
- Code2 将byte数组转换为字符串
- 关于c# byte[]型数组转换成字符串
- ByteArrayOutputStream 中的byte数组转换成字符串
- 将byte数组转换成对应的十六进制的字符串形式
- Android 字符串、byte数组与16进制数组间的转换
- 用sscanf转换MAC字符串为BYTE数组时遇到的问题
- 汉字字符串转换成十六进制byte数组,一个汉字存到两个byte里面,大整数存到两个byte里面
- java中字节数组和字符串、IO流和字节数组之间的转换
- MSDN将字节数组转换为十六进制值字符串时 Byte 的用法
- 黑马程序员:数组及字符串IO流:ByteArrayInputStream、CharArrayReader、StringReader等
- Code1 将字符串转换为byte数组
- 字符串string和内存流MemoryStream及比特数组byte[]互转比转换
- 将16进制的字符串转换成byte数组
- vb6.0 Byte数组转换为字符串(兼容中英文)
- 将字节数组转换为十六进制值字符串时 Byte 的用法
- 在VB中把字符串转换成Byte数组
- 黑马程序员_学习日记40_605基础加强(自定义泛型、装拆箱、foreach、文件操作、字符串与byte数组转换)
- FileInPutStream转换成byte数组
- 05-数组转换成字符串(字符串处理)