Entrance Exams
Govt. Exams
CipherOutputStream allows transparent encryption of data written through it, properly integrating with Java's cryptography framework.
The unread() method of PushbackInputStream allows you to push bytes back into the stream so they can be read again.
PrintWriter is synchronized, making it thread-safe. Other stream classes are not inherently thread-safe and require external synchronization in multi-threaded contexts.
If no charset is explicitly provided, InputStreamReader uses the platform's default charset, which varies by system configuration.
SAX parsers and streaming XML parsers process XML sequentially without loading the entire document, making them ideal for large files.
RandomAccessFile allows reading and writing at arbitrary positions using seek() method, useful for direct access to file contents.
For real-time applications requiring minimal latency, smaller buffer sizes and frequent flushing ensure data is processed immediately rather than waiting for buffer to fill.
InvalidClassException is thrown when a serialized object's serialVersionUID doesn't match the current class definition, indicating an incompatible class version.
FileReader is a character-based stream that reads characters from a file. InputStream and its subclasses are byte-based streams.
The flush() method clears the internal buffer and forces any buffered output to be written to the underlying stream without closing it.