Sitelet https://github.com/java/devjava-content/issues/275
Skip to content

In Decorating I/O Streams, Files.size(path) should be inside a try-catch statement #275

Description

@authentictech

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