In Decorating I/O Streams, Files.size(path) should be inside a try-catch statement · Issue #275 · java/devjava-content
Repository navigation
In Decorating I/O Streams, Files.size(path) should be inside a try-catch statement #275
New issue
New issue
Open
Open
In Decorating I/O Streams, Files.size(path) should be inside a try-catch statement #275
Description
@authentictech's profile authentictech opened on Aug 19, 2026In Tutorials > The Java I/O API > File Operations Basics > Decorating I/O Streams, section "Writing Characters using an OutputStreamWriter ", the example code has the line long size = Files.size(path);.
This code should be within a try-catch block of it's own as it throws IOException.
Same applies to first code snippet in "Handling Compressed Binary Streams" section later in the article.