How to recognize “broken” files by exceptions (
EOFException,
MalformedInputException,
ZipException,
StreamCorruptedException), what to do when the format does not match, and which recovery strategies to use: logging and notifying the user, partial reading up to the error, backups, checksums (
SHA-256). Practice reading until
EOF, correct handling of encodings, and analysis of common mistakes (validation,
try-with-resources, careful overwrite).