← Winnitude! Search  ·  Reader Mode (1488 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 7 LINKS

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, 2026

In 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions