DataBufferUtils.read should not take input stream/channel as parameter

Fixed by creating `Callable`-based variants, as explained in the JIRA
issue.

Issue: SPR-16403
This commit is contained in:
Arjen Poutsma
2018-01-19 17:37:40 +01:00
parent 09f1f727a7
commit 5520e730f1
3 changed files with 175 additions and 97 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@ package org.springframework.http.codec.multipart;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
@@ -268,8 +267,8 @@ public class SynchronossPartHttpMessageReader implements HttpMessageReader<Part>
@Override
public Flux<DataBuffer> content() {
InputStream inputStream = this.storage.getInputStream();
return DataBufferUtils.read(inputStream, getBufferFactory(), 4096);
return DataBufferUtils.readInputStream(this.storage::getInputStream, getBufferFactory(),
4096);
}
protected StreamStorage getStorage() {