1. Summary of this week's study
- Classes derived from InputStream or reader contain a basic method called Read (), which is used to read a single-byte or byte array. Similarly, any class derived from OutputStream or writer has a basic method called write (), which is used to write a single byte or an array of bytes. However, we do not usually use these methods.
- Classes that produce input from different data sources have corresponding InputStream subclasses.
- The BufferedReader constructor, which provides the ReadLine () method.
- With Dateinputstream. It is a byte-oriented I/O class that must use the InputStream class
2. System-oriented integrated design-Library management system or Shopping cart 2.1 describes how to use streams and files to transform your system. What is the format of the data in the file?
I'm using BufferedWriter
classes and BufferedReader
classes to keep books and users ' properties separated by spaces. The data is stored in a. txt file as a string.
2.2 Brief description of what interfaces and classes are used in the file reading and writing section of the system with the stream associated with the file? Why use these interfaces with classes?
- Read with classes, classes,
File
FileReader
BufferedReader
classes, files created through file objects, and the other two classes with the read.
- Write files are used to
BufferedWriter
, OutputStreamWriter
, FileOutputStream
.
2.3 Read and write file-related code. Key lines need to be annotated
3. Code volume Statistics 3.1 Statistics The amount of code done this week selected: 4. Stream and Document Learning Guide 1. Character stream with text file: Use PrintWriter (write), BufferedReader (Read)
201621123086 Java programming 12th Week of study summary