java 字节流写入中文
来源:互联网 发布:淘宝冻结账户开通 编辑:程序博客网 时间:2024/05/21 18:37
package com.heima.test;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;public class test2 {public static void main(String[] args) throws IOException {// TODO Auto-generated method stub// demo2();// 字节流写出中文FileOutputStream fos = new FileOutputStream("yyy.txt");fos.write("我读书少你别骗我".getBytes());// 字节流换行fos.write("\r\n".getBytes());fos.write("我读书少你别骗我".getBytes());fos.close();}private static void demo2() throws FileNotFoundException, IOException {BufferedInputStream bis = new BufferedInputStream(new FileInputStream("aaa.txt"));BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("ddd.txt"));int vaule;while ((vaule = bis.read()) != -1) {bos.write(vaule);}bos.close();bis.close();}}
0 0
- java 字节流写入中文
- java IO流字节流写入大写字母
- android / java 字节流写入文件
- Java 字节流 读取和写入
- 通过java字节流复制文件,逐个字节读取写入
- java缓冲字节流复制文件,逐个字节读取、写入
- 文件写入字节流
- Java之基于字节流文件的写入和读取
- java把文件写入内存---输出字节流
- Java-文件读取写入整型(字节流)
- java(147)字节流文件读取,写入,追加文件
- java 使用IO字节流将一句话写入文件
- Java中文字节长度
- Java中文件的写入
- java 中文件写入读出
- JAVA按字节截取中文
- java 中文字符字节大小
- JAVA中文字节编码确认
- PHP yii的安装
- POJ2449-Remmarguts' Date(K短路)
- 集合
- iOS使用UICountingLabel实现数字变化的动画效果
- 【OVS2.5.0源码分析】datapath之action分析(1)
- java 字节流写入中文
- 8.Java基础:常见IO流----->字符流中的转化流:OutputStreamWriter、InputStreamReader
- JQuery 插件 Validation Plugin
- centos之lnmp
- [一类维护形态树和值树的LCT] BZOJ 3159 决战
- hdu 5437
- 数据结构实验之链表一:顺序建立链表
- memset函数解析
- JavaScript: missing ) after argument list,js获取s:property值的问题