Đang chuẩn bị liên kết để tải về tài liệu:
Introduction to java programming: Chapter 18 - Binary I/O

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Introduction to java programming: Chapter 18 - Binary I/O's Objectives is to understand how I/O is processed in Java; distinguish between text I/O and binary I/O; read and write bytes using FileInputStream and FileOutputStream; read and write primitive values and strings using DataInputStream/DataOutputStream. | Chapter 18 Binary I O Chapter 9 Inheritance and Polymorphism Chapter 17 Exceptions and Assertions T Chapter 18 Binary I O Chapter 6 Arrays Chapter 19 Recursion Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13-148952-6 Objectives To understand how I O is processed in Java 18.2 . To distinguish between text I O and binary I O 18.3 . To read and write bytes using FileInputStream and FileOutputStream 18.4.1 . To read and write primitive values and strings using DataInputStream DataOutputStream 18.4.3 . To store and restore objects using ObjectOutputStream and ObjectInputStream and to understand how objects are serialized and what kind of objects can be serialized 18.6 . To use the Serializable interface to enable objects to be serializable 18.6.1 . To know how to serialize arrays 18.6.2 . To use RandomAccessFile for both read and write 18.7 Optional . Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13-148952-6 How is I O Handled in Java A File object encapsulates the properties of a file or a path but does not contain the methods for reading writing data from to a file. In order to perform I O you need to create objects using appropriate Java I O classes. Scanner input new Scanner new File temp.txt System.out.println input.nextLine Program Input object created from an input class Input stream 01011.1001 Output object reẾted from an output class 11001.1011 Output stream Formatter output new Formatter temp.txt output.format s Java 101 output.close Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13-148952-6