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

Fixing DataOutputStream usage #343

Merged
merged 1 commit into from
Jan 28, 2016
Merged

Conversation

emopers
Copy link
Contributor

@emopers emopers commented Jan 11, 2016

When a DataOutputStream instance is created, it is a good practice to call flush/close explicitly after finish writing to the stream as mentioned for example here.
Moreover, other places in this project, a close/flush is called on DataOutputStream instance after finish writing to stream for example here.
In the test TestBuilder.java, a DataOutputStream instance wraps an underlying ByteArrayOutputStream instance and invokes the underlying instances's toByteArray() without calling recommended close/flush method.
This pull request adds a flush method at appropriate place and also fix the issue with the test TestBuilder.java as mentioned above. This PR is similar to my earlier accepted PR

@jodastephen
Copy link
Member

While I'm not convinced it is necessary, this will cause no harm.

jodastephen added a commit that referenced this pull request Jan 28, 2016
Fixing DataOutputStream usage
@jodastephen jodastephen merged commit e7e6d78 into JodaOrg:master Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants