Flushes and closes the framer and releases any buffers. After the framer is closed or disposed, additional calls to this method will have no affect.
()
| 325 | * disposed, additional calls to this method will have no affect. |
| 326 | */ |
| 327 | @Override |
| 328 | public void close() { |
| 329 | if (!isClosed()) { |
| 330 | closed = true; |
| 331 | // With the current code we don't expect readableBytes > 0 to be possible here, added |
| 332 | // defensively to prevent buffer leak issues if the framer code changes later. |
| 333 | if (buffer != null && buffer.readableBytes() == 0) { |
| 334 | releaseBuffer(); |
| 335 | } |
| 336 | commitToSink(true, true); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Closes the framer and releases any buffers, but does not flush. After the framer is |