24 questions for “I/O & NIO”

Found in 1 field. Select a question to see its full answer.

Matching topics

Information Technology

24 questions in 2 technologies

#QuestionTechnologyTopicLevel
1How does java.nio's Channel and Buffer abstraction differ fundamentally from the classic java.io Stream model, and what specific capability does this enable for non-blocking I/O? Java › I/O & NIOJavaI/O & NIOAdvanced
2How would you implement asynchronous file I/O using AsynchronousFileChannel, and how does this differ from both the classic blocking java.io model and NIO's Selector-based non-blocking channels? Java › I/O & NIOJavaI/O & NIOAdvanced
3How do you read all bytes or all lines of a small-to-medium text file in a single, concise call using modern NIO.2 utility methods? Java › I/O & NIOJavaI/O & NIOBeginner
4How does wrapping a FileInputStream in a BufferedInputStream (or FileReader in a BufferedReader) improve I/O performance, and what's the mechanism behind this improvement? Java › I/O & NIOJavaI/O & NIOIntermediate
5What are the modern java.nio.file utility classes (Path, Files) introduced in Java 7 (NIO.2), and how do they improve on the older java.io.File class? Java › I/O & NIOJavaI/O & NIOIntermediate
6How would you use try-with-resources combined with multiple chained I/O wrapper classes (like FileInputStream wrapped in BufferedInputStream wrapped in GZIPInputStream) to correctly read a compressed file while ensuring all layers are properly closed? Java › I/O & NIOJavaI/O & NIOIntermediate
7How would you use the WatchService API (java.nio.file) to monitor a directory for file system changes (creation, modification, deletion) in real time? Java › I/O & NIOJavaI/O & NIOIntermediate
8How would you implement memory-mapped file I/O using MappedByteBuffer, and what performance advantage does this provide for very large files compared to traditional stream-based reading? Java › I/O & NIOJavaI/O & NIOAdvanced
9What is the difference between byte streams (InputStream/OutputStream) and character streams (Reader/Writer) in the classic java.io package? Java › I/O & NIOJavaI/O & NIOBeginner
10How would you implement object serialization using ObjectOutputStream/ObjectInputStream, and what does the Serializable marker interface and serialVersionUID actually do? Java › I/O & NIOJavaI/O & NIOIntermediate