import java.io.*; public class OutputStr { public static void main(String[] args) throws Exception { File file = new File("D:\\temp","write.txt"); OutputStream os = new FileOutputStream(file); // os.write(89); //参数是 int类型 String str = "haahahahah"; os.write(str.getBytes()); os.flush();//清空缓存 os.close(); } }
OutputStream
原创文章标签 OutputStream 文章分类 Java 后端开发
上一篇:xxOutputStream xxInputStream
下一篇:Iterator
-
Java 中数组的使用(一维数组和二维数组)
本文详细的介绍了,在Java 中数组的使用,并对其内存存在形式进行了详细的分析。
数组 一维数组 二维数组 java基础 -
Android byte数组转float byte数组转file类型
基本类型概念java的基本数据类型可以简称为四类八种:整型:(byte、short、int、long):整数数据类型默认是int浮点型:(float、double)字符型:(char)布尔类型:(boolean):true 真 和 false 假byte -> short -> char -> int -> long -> float ->double(小到大)
byte数组转为string乱码 byte转换为string乱码 c++ char 转 string c++ char 转string c++ char*转string