Entrance Exams
Govt. Exams
DataInputStream provides methods like readInt(), readDouble(), readBoolean() to read primitive data types from a binary file.
RandomAccessFile allows seeking to the file's end to read only new appended data efficiently.
InvalidClassException is thrown when deserialized class's serialVersionUID doesn't match the serialized object.
Reading each line requires processing each character once, resulting in O(n) complexity where n is total characters.
SequenceInputStream concatenates multiple input streams, allowing them to be read as one continuous stream.
FileChannel enables non-blocking operations and memory-mapping, offering better performance for large files.
PrintWriter suppresses IOException and continues silently, unlike other streams.
RandomAccessFile allows seeking to any position in the file without sequential reading, ideal for random access.
serialVersionUID identifies class versions. Mismatched versions cause InvalidClassException during deserialization.
BufferedReader buffers input, reducing system calls and I/O overhead, improving performance significantly.