Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Prefers OutputStream instead of FileOutputStream to improve performance.#79

Open
reudismam wants to merge 1 commit into
apache:trunkfrom
reudismam:pr01
Open

Prefers OutputStream instead of FileOutputStream to improve performance.#79
reudismam wants to merge 1 commit into
apache:trunkfrom
reudismam:pr01

Conversation

@reudismam

Copy link
Copy Markdown

No description provided.

@dlogothetis

dlogothetis commented Aug 24, 2018

Copy link
Copy Markdown
Contributor

Can you comment on how this improves performance?

@reudismam

Copy link
Copy Markdown
Author

FileInputStream and FileOutputStream override the finalize method. As a result, their objects are only cleaned when the garbage collector performs a sweep. Since Java 7, programmers can use Files.newInputStream and Files.newOutputStream instead of FileInputStream and FileOutputStream to improve performance. finalize method is deprecated in Java 9+.

@dlogothetis dlogothetis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reudismam, how did you test this change?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants