数组、字符串流
来源:互联网 发布:淘宝如何看自己退货率 编辑:程序博客网 时间:2024/05/16 08:32
* ByteArrayInputStream 字节数组输入流
*
* ByteArrayOutputStream 字节数组输出流
*
* CharArrayReader 字符数组写入流
*
* CharArrayWriter 字符数组输出流
*
* StringReader 字符串写入流
*
* StringWriter 字符串输出流
*
*
* ByteArrayOutputStream 字节数组输出流
*
* CharArrayReader 字符数组写入流
*
* CharArrayWriter 字符数组输出流
*
* StringReader 字符串写入流
*
* StringWriter 字符串输出流
*
public static void method_1(){//从输入流的字符数组中读取到内存中,即写入到内存ByteArrayInputStream bais = new ByteArrayInputStream("abcdefg".getBytes());//从内存中读取到输出的字节数组中,即从内存输出ByteArrayOutputStream baos = new ByteArrayOutputStream();int len = 0;while((len = bais.read())!=-1){baos.write(len);}System.out.println(baos.toString());}--------------------------------------------------------public static void method_2() throws Exception{CharArrayReader car = new CharArrayReader("abcdefghijk".toCharArray());CharArrayWriter caw = new CharArrayWriter();int len = 0;while((len = car.read())!=-1){caw.write(len);}System.out.println(caw.toString());}public static void method_3() throws Exception{StringReader sr = new StringReader("ABCDEFG");StringWriter sw = new StringWriter();int len = 0;while((len = sr.read())!=-1){sw.write(len);}System.out.println(sw);}
- 数组、字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- 字符串流
- C++ 文件流、字符串流、字符数组、字符串
- IO流之字节数组流和字符串流
- 黑马程序员-----IO之字节数组流、字符数组流和字符串流
- C++字符串流
- 字符串流stringstream
- 字符串流的使用
- 字符串流题目
- 字符串流的用法
- Tiny210 uboot 移植 No NAND device found!!!
- android wap联网
- db2 中的DECIMAL 数字数据类型
- 管道流
- QT实现预编译的浏览器插件 JS与QT对象进行交互
- 数组、字符串流
- KindEditor js 路径修改及表单提交注意事项
- 【工具】Visual studio 2010 扩展管理器常用插件
- 数据流(基本数据类型)
- uva-10115
- Wireshark Win7/Linux小试
- ORACLE PARAMETERS--- COMMIT_POINT_STRENGTH
- struts2 and json 注解
- linux shell中 if else以及大于、小于、等于逻辑表达式介绍