Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially confusing statement about DirectoryStream #67

Open
cayhorstmann opened this issue Feb 1, 2024 · 1 comment
Open

Potentially confusing statement about DirectoryStream #67

cayhorstmann opened this issue Feb 1, 2024 · 1 comment

Comments

@cayhorstmann
Copy link
Contributor

In https://dev.java/learn/java-io/file-system/listing/, it says:

Remember: The returned DirectoryStream is a stream. If you are not using a try-with-resources statement, do not forget to close the stream in the finally block. The try-with-resources statement takes care of this for you. You can learn more about stream in the Stream section.

What does "...is a stream" mean? A java.util.stream.Stream? A java.io.InputStream or java.io.OutputStream? It is neither. Maybe the author meant "...is an AutoCloseable"?

@danthe1st
Copy link
Contributor

danthe1st commented Mar 6, 2024

I think it's supposed to refer to java.util.stream.Stream.

However, it neither implements Stream nor InputStream nor OutputStream so I assume it's just wrong/a simple mistake instead of a confusing statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants