Flush bytes or chars contained in the buffer. @param realFlush true if this should also cause a real network flush @throws IOException An underlying IOException occurred
(boolean realFlush)
| 264 | * @throws IOException An underlying IOException occurred |
| 265 | */ |
| 266 | protected void doFlush(boolean realFlush) throws IOException { |
| 267 | |
| 268 | if (suspended) { |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | try { |
| 273 | doFlush = true; |
| 274 | if (initial) { |
| 275 | coyoteResponse.commit(); |
| 276 | initial = false; |
| 277 | } |
| 278 | if (cb.remaining() > 0) { |
| 279 | flushCharBuffer(); |
| 280 | } |
| 281 | if (bb.remaining() > 0) { |
| 282 | flushByteBuffer(); |
| 283 | } |
| 284 | } finally { |
| 285 | doFlush = false; |
| 286 | } |
| 287 | |
| 288 | if (realFlush) { |
| 289 | coyoteResponse.action(ActionCode.CLIENT_FLUSH, null); |
| 290 | // If some exception occurred earlier, or if some IOE occurred |
| 291 | // here, notify the servlet with an IOE |
| 292 | if (coyoteResponse.isExceptionPresent()) { |
| 293 | throw new ClientAbortException(coyoteResponse.getErrorException()); |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | } |
| 298 | |
| 299 | |
| 300 | // ------------------------------------------------- Bytes Handling Methods |
no test coverage detected