servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultSizeAwareClassHttpSerializer.java [47:82]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.addContentType = addContentType;
        this.serializer = serializer;
        this.type = type;
        this.bytesEstimator = bytesEstimator;
    }

    @Override
    public Buffer serialize(final HttpHeaders headers, final T value, final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, bytesEstimator.applyAsInt(0));
    }

    @Override
    public BlockingIterable<Buffer> serialize(final HttpHeaders headers, final BlockingIterable<T> value,
                                              final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, type, bytesEstimator);
    }

    @Override
    public Publisher<Buffer> serialize(final HttpHeaders headers, final Publisher<T> value,
                                       final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, type, bytesEstimator);
    }

    @Override
    public HttpPayloadWriter<T> serialize(final HttpHeaders headers, final HttpPayloadWriter<Buffer> payloadWriter,
                                          final BufferAllocator allocator) {
        addContentType.accept(headers);
        return new DelegatingToBufferHttpPayloadWriter<T>(payloadWriter, allocator) {
            @Override
            public void write(final T object) throws IOException {
                delegate.write(serializer.serialize(object, allocator, bytesEstimator.applyAsInt(0)));
            }
        };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultSizeAwareTypeHttpSerializer.java [47:82]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.addContentType = addContentType;
        this.serializer = serializer;
        this.type = type;
        this.bytesEstimator = bytesEstimator;
    }

    @Override
    public Buffer serialize(final HttpHeaders headers, final T value, final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, bytesEstimator.applyAsInt(0));
    }

    @Override
    public BlockingIterable<Buffer> serialize(final HttpHeaders headers, final BlockingIterable<T> value,
                                              final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, type, bytesEstimator);
    }

    @Override
    public Publisher<Buffer> serialize(final HttpHeaders headers, final Publisher<T> value,
                                       final BufferAllocator allocator) {
        addContentType.accept(headers);
        return serializer.serialize(value, allocator, type, bytesEstimator);
    }

    @Override
    public HttpPayloadWriter<T> serialize(final HttpHeaders headers, final HttpPayloadWriter<Buffer> payloadWriter,
                                          final BufferAllocator allocator) {
        addContentType.accept(headers);
        return new DelegatingToBufferHttpPayloadWriter<T>(payloadWriter, allocator) {
            @Override
            public void write(final T object) throws IOException {
                delegate.write(serializer.serialize(object, allocator, bytesEstimator.applyAsInt(0)));
            }
        };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



