@Override
    protected void beforeComplete(Subscriber<? super HttpObject> subscriber) {
        closeEncoder(false);
        if (encodedStream == null) {
            return;
        }

        final ByteBuf buf = encodedStream.buffer();
        if (buf.isReadable()) {
            try {
                subscriber.onNext(HttpData.wrap(buf));
            } catch (Throwable t) {
                subscriber.onError(t);
                throwIfFatal(t);
                logger.warn("Subscriber.onNext() should not raise an exception. subscriber: {}",
                            subscriber, t);
            }
        } else {
            buf.release();
        }
    }
A {@link FilteredStreamMessage} that applies HTTP encoding to {@link HttpObject}s as they are published.
core/src/main/java/com/linecorp/armeria/server/encoding/HttpEncodedResponse.java