2、 OutputStream类 ● write(intb):将一个整数输出到流中 write( byte b):将数组中的数据输出到流中 ● write( byte bl, int of; int len):将数组b中从of指 定的位置开始len长度的数据输出到流中 ● flush(:将缓冲区中的数据强制送出 ● closed:关闭流 G carre
⚫ write(int b):将一个整数输出到流中 ⚫ write(byte b[]):将数组中的数据输出到流中 ⚫ write(byte b[], int off,int len):将数组b中从off指 定的位置开始len长度的数据输出到流中 ⚫ flush():将缓冲区中的数据强制送出 ⚫ close():关闭流 2、OutputStream类
例83 import java. io. *: public class TestOutputstream public static void main( String args) i int count; byte input= new bytel256];/用月于字节输入缓冲的数组 String s; BufferedInputstream bufin= new BufferedInputStream(System. in) 用键盘输入创建缓冲字节输入流对象 butin Bufferedoutputstream bufout=new BufferedoutputStream(System. out); 用屏幕输出创建缓冲字节输出流对象 buyout G carre
例8.3 import java.io.*; public class TestOutputStream { public static void main(String args[]) { int count; byte input[] = new byte[256]; //用于字节输入缓冲的数组 String s; BufferedInputStream bufin = new BufferedInputStream(System.in); //用键盘输入创建缓冲字节输入流对象bufin BufferedOutputStream bufout =new BufferedOutputStream(System.out); //用屏幕输出创建缓冲字节输出流对象bufout