File Handling in Java with Path and Files
Path names a location and Files performs the operations. Together they replaced the older File class for almost every purpose.
Path and Files, byte and character streams, buffering and serialization.
4 notes
Path names a location and Files performs the operations. Together they replaced the older File class for almost every purpose.
InputStream and OutputStream carry raw bytes; Reader and Writer carry characters. Choosing wrongly corrupts data.
Every unbuffered read is a system call. Buffering turns thousands of them into a handful, and it is the single largest I/O win available.
Serialization turns an object graph into bytes and back. It is easy to switch on, hard to maintain, and a genuine security risk.