@Override public TransformablePublisher<? extends ByteBuf> getBodyStream(long maxContentLength) { if (bodyReader == null) { return EmptyPublisher.instance(); } else { return bodyReader.readStream(maxContentLength); } }
@Override public Promise<TypedData> getBody(long maxContentLength, Block onTooLarge) { if (bodyReader == null) { return Promise.value(new ByteBufBackedTypedData(Unpooled.EMPTY_BUFFER, getContentType())); } else { return bodyReader .read(maxContentLength, onTooLarge) .map(b -> (TypedData) new ByteBufBackedTypedData(b, getContentType())); } }
@Override public long getContentLength() { return bodyReader == null ? -1L : bodyReader.getContentLength(); }