FlushGuardedOutputStream does not override write(byte[]) and write(byte[], int, int) method. Therefore, the previous code calls the delegate's write(int) which performs a lot of checks on buffer length while creating a lot of garbage. By overriding write(byte[]) and write(byte[], int, int) help improving performance by calling into the respective methods directly

Comment From: pivotal-cla

@testn Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@testn Thank you for signing the Contributor License Agreement!

Comment From: snicoll

Thanks for the PR @testn but this code is deprecated and removed in the current line so we're not going to make further changes to it.