nbt icon indicating copy to clipboard operation
nbt copied to clipboard

Flushing DataOutputStream before calling toByteArray on the underlying ByteArrayOutputStream

Open emopers opened this issue 8 years ago • 0 comments

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().

emopers avatar Mar 07 '16 19:03 emopers