【计算机】10 IO系统.pptVIP

  • 0
  • 0
  • 约1.14万字
  • 约 41页
  • 2018-02-26 发布于江苏
  • 举报
【计算机】10 IO系统

第10章 IO系统 10.1 IO流简介 10.2 字节流 10.3 过滤流类 10.4 Reader及Writer 10.5 标准输入、输出 10.6 IO流的应用实例 第10章 IO系统(续) 10.7 随机文件访问 10.8 文件及目录管理 10.9 习题 10.1 IO流简介 通过流的概念,程序员可以把输入或输出的数据看作是一个字节数据流(或字符数据流等)。 通过流,程序可以从各种输入设备读入数据,向各种输出设备输出数据。 按照目的的不同,流可分为输入流和输出流。 10.2 字节流 字节输入流: InputStream是所有字节输入流的基类。 字节输出流: OutputStream是所有字节输出流类的基类。 10.2.1 InputStream public abstract int read() throws IOException public int read(byte[] b) throws IOException public long skip(long n) throws IOException public int available() throws IOException public void close() throws IOException 10.2.1 InputStream(续) ByteArrayInputStream FileInputStream PipedInputStream StringBufferInputStream SequenceInputStream FilterInputStream 10.2.2 OutputStream public abstract void write(int b) throws IOException public void write(byte[] b) throws IOException public void flush() throws IOException public void close() throws IOException 10.2.2 OutputStream(续) ByteArrayOutputStream PipedOutputStream FileOutputStream FilterOutputStream 例10-1 文件输入输出 CopyFile CopyFile.java toFile.java 10.3 过滤流类 FilterInputStream DataInputStream BufferedInputStream LineNumberInputStream FilterOutputStream DataOutputStream BufferedOutputStream PrintStream 10.3.1 FilterInputStream DataInputStream: boolean readBoolean() throws IOException char readChar() throws IOException int readShort() throws IOException int readByte() throws IOException int readInt() throws IOException int readLong() throws IOException float readFloat() throws IOException double readDouble() throws IOException 10.3.2 FilterOutputStream DataOutputStream: void writeBoolean(boolean b) throws IOException void writeChar(char c) throws IOException void writeShort(short s) throws IOException void writeByte(byte b) throws IOException void writeInt(int i) throws IOException void writeLong(long l) throws IOException void writeFloat(float f) throws IOException void writeDouble(double d) throws IOException 10.3.2

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档