Skip to content
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.

Flushing DataOutputStream before calling toByteArray on the underlying ByteArrayOutputStream #5

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

Conversation

emopers
Copy link

@emopers emopers commented Mar 7, 2016

EndianSwitchableOutputStream.java internally uses DataOutputStream as its stream and when a DataOutputStream instance wraps an underlying ByteArrayOutputStream instance,
it is recommended to flush or close the DataOutputStream before invoking the underlying instances's toByteArray(). Also, it is a good practice to call flush/close explicitly as mentioned for example here.
This pull request adds a flush method before calling toByteArray().

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.

1 participant