package test; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; /** * @author shusheng * @description * @Email shusheng@yiji.com * @date 2018/11/12 9:21 */ public class BufferedOutputSteamDemo1 { public static void main(String[] args) throws IOException { //构造方法可以指定缓冲区的大小,但是我们一般用不上,因为默认缓冲区大小就足够了 BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream("C:\Users\shusheng\Pictures\111.txt")); bos.write("hello".getBytes()); bos.close(); } }