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

Prefers OutputStream instead of FileOutputStream to improve performance. #79

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

reudismam
Copy link

No description provided.

@dlogothetis
Copy link
Contributor

dlogothetis commented Aug 24, 2018

Can you comment on how this improves performance?

@reudismam
Copy link
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+.

Copy link
Contributor

@dlogothetis dlogothetis left a comment

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