Files and Streams: Understanding Data Storage and Transmission in Computing - Prof. Joseph, Study notes of Computer Science

This chapter explores the concept of files and streams in computing, focusing on long-term data retention using secondary storage devices such as hard disks, optical disks, flash drives, and magnetic tapes. Learn about persistent data, data hierarchy, record keys, and organizing records in sequential files. Discover how java views files as streams of bytes and the use of classes like fileinputstream, fileoutputstream, filereader, filewriter, and file for managing files and directories.

Typology: Study notes

Pre 2010

Uploaded on 12/10/2009

dr-pepper
dr-pepper ๐Ÿ‡บ๐Ÿ‡ธ

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CHAPTER 17: FILES AND STREAMS
1. Files โ€“ long term retention of data
2. Computers use secondary storage devices
a. Hard disks, optical disks, flash drives, and magnetic tapes
3. Persistent data โ€“ data maintained in files
4. Data stored in variables and arrays are temporary
5. KNOW THE DATA HIERARCHY
a. Bit
i. Either a 0 or a 1
b. Character set
i. Java uses Unicode characters which are two bytes
1. A byte is composed of 8 bits
c. Fields
i. Composed of characters or bytes
ii. Group of characters or bytes that conveys meaning
d. Record
e. File
6. Record Key โ€“ identifies a record as belonging to a particular person or entity and is unique to each record
7. Most common way to organize records in a file is a sequential file
a. Stored in order of the record-key field
8. Database โ€“ a group of related files
a. DBMS (database management system) โ€“ a collection of programs designed to create and manage
databases.
9. Java views file as a sequential stream of bytes
10. Operating systems provides ways to determine when the end of a file comes, the end of the file marker
11. Java creates an object associated with a stream of bytes or characters in order to open a file
12. Class System is the big class that has methods and premade objects that will aid you with files and
streams
13. Uses class from package java.io
a. Has classes
i. FileInputStream
ii. FileOutputStream
iii. FileReader
iv. FileWriter
14. Class File provides information about files and directories
15. Character-based input and output can be performed with classes Scanner and Formatter
a. Scanner is used to input data
i. Can read data
b. Formatter is used to format the output
i. Such as printf
16. File provides four different constructors
17. Absolute path - contains all the directories
18. Root directory โ€“ leads to a specific file or directory
19. Separator character โ€“ used to separate directories and files in the path
pf2

Partial preview of the text

Download Files and Streams: Understanding Data Storage and Transmission in Computing - Prof. Joseph and more Study notes Computer Science in PDF only on Docsity!

CHAPTER 17: FILES AND STREAMS

  1. Files โ€“ long term retention of data
  2. Computers use secondary storage devices a. Hard disks, optical disks, flash drives, and magnetic tapes
  3. Persistent data โ€“ data maintained in files
  4. Data stored in variables and arrays are temporary
  5. KNOW THE DATA HIERARCHY a. Bit i. Either a 0 or a 1 b. Character set i. Java uses Unicode characters which are two bytes 1. A byte is composed of 8 bits c. Fields i. Composed of characters or bytes ii. Group of characters or bytes that conveys meaning d. Record e. File
  6. Record Key โ€“ identifies a record as belonging to a particular person or entity and is unique to each record
  7. Most common way to organize records in a file is a sequential file a. Stored in order of the record-key field
  8. Database โ€“ a group of related files a. DBMS (database management system) โ€“ a collection of programs designed to create and manage databases.
  9. Java views file as a sequential stream of bytes
  10. Operating systems provides ways to determine when the end of a file comes, the end of the file marker
  11. Java creates an object associated with a stream of bytes or characters in order to open a file
  12. Class System is the big class that has methods and premade objects that will aid you with files and streams
  13. Uses class from package java.io a. Has classes i. FileInputStream ii. FileOutputStream iii. FileReader iv. FileWriter
  14. Class File provides information about files and directories
  15. Character-based input and output can be performed with classes Scanner and Formatter a. Scanner is used to input data i. Can read data b. Formatter is used to format the output i. Such as printf
  16. File provides four different constructors
  17. Absolute path - contains all the directories
  18. Root directory โ€“ leads to a specific file or directory
  19. Separator character โ€“ used to separate directories and files in the path

a. Windows use a backslash b. Linux/Unix use a forward slash c. Java can use either of them