File Handling, Streams, and Serialization Flashcards
What is file handling?
File handling refers to performming operations on files be it creating, opening, reading, writing, and closing files.
What packages are used for handling files in Java?
java.nio.file,
java.io.File
What class is commonly used for file handling in java?
The File class
What is a stream?
A stream is a sequence of data that eases reading from and writing to varios data sources like files, memory buffers or network connections
What are two type of stream you know?
Byte and Character streams
What is a Byte Stream?
It is a stream to handle input and output of 8bit bytes, suitabale fror raw binary data like images, audio files or other multimedia content. using classes like InputStream, and OutputStream
What is a character Stream?
These streams handle 16bit Unicode characters, making them best fro reading and writing text data as they automaticaly character encoding and decoding. Using classes like FileReader, or File Writer
What is Serialization?
It is the process of converting an object into a byte stream, allowing it to be easily saved to a file, sent over a network, or stored in a database.