A simple optimization to reduce duplicate code. Reduce the codeSize of writeBody from 268 to 240
------------- Commit messages: - optimize writeBody Changes: https://git.openjdk.org/jdk/pull/21440/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21440&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341900 Stats: 18 lines in 1 file changed: 5 ins; 10 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21440.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21440/head:pull/21440 PR: https://git.openjdk.org/jdk/pull/21440