public void terminateWrites() throws IOException {
final long val = enterShutdown();
if (anyAreSet(val, MASK_COUNT)) {
try {
throw new FixedLengthUnderflowException((val & MASK_COUNT) + " bytes remaining");
} finally {
next.truncateWrites();
}
} else if (allAreSet(config, CONF_FLAG_PASS_CLOSE)) {
next.terminateWrites();