Exemplo n.º 1
0
 @Override
 public TransformablePublisher<? extends ByteBuf> getBodyStream(long maxContentLength) {
   if (bodyReader == null) {
     return EmptyPublisher.instance();
   } else {
     return bodyReader.readStream(maxContentLength);
   }
 }
Exemplo n.º 2
0
 @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()));
   }
 }
Exemplo n.º 3
0
 @Override
 public long getContentLength() {
   return bodyReader == null ? -1L : bodyReader.getContentLength();
 }