第九章流、文件及文本应用1§1流式输入与输出一、流(stream): 1、实际上指在计算机的输入与输出之间运动的数据序列。 2、两种基本流输入流:只能从中读取数据输出流:只能向其写入数据 3、 定义了多个类,处理不同性质的输入输出流2应用程序键盘文件网络显示器文件网络10101111zhangwang输入源输入流输出流输出源3资源Java程序Java程序资源可以是本地文件、网络上的文件、键盘、显示器等输入流输出流ReadingWritingopen a streamwhile more information read informationclose the streamopen a streamwhile more information write informationclose the stream4二、字节流与字符流字节流字符流输入输出单位InputStreamOutputStreamReaderWriterbytechar这四个类都是抽象类51、InputStream publicintread(); publicintread(byteb[]); publicintread(byte[]b,intoff,intlen); publiclongskip(longn); publicintavailable(); publicvoidclose();……1001010010011**********……应用程序672、OutputStreampublicvoidwrite(intb);publicvoidwrite(byteb[]);publicvoidwrite(byte[]b,intoff,intlen);publicvoidflush();(用于缓冲式输出流)publicvoidclose();……10010100应用程序893、Reader类 publicintread(); publicintread(charb[]); publicintread(char[]b,intoff,intlen); publiclongskip(longn); publicintavailable(); publicvoidclose();……‘h’‘e’‘l’‘l’‘o’……应用程序10
java课件第九章 来自淘豆网m.daumloan.com转载请标明出处.