Fixed bug in reading Flux from Channel
Fixed bug where the returned Flux from DataBufferUtils.read() would be completed prematurely if the channel was not ready to read, but did not reach the end of the file either.
This commit is contained in:
@@ -164,7 +164,7 @@ public abstract class DataBufferUtils {
|
||||
try {
|
||||
ByteBuffer byteBuffer = ByteBuffer.allocate(chunkSize);
|
||||
int read;
|
||||
if ((read = channel.read(byteBuffer)) > 0) {
|
||||
if ((read = channel.read(byteBuffer)) >= 0) {
|
||||
byteBuffer.flip();
|
||||
boolean release = true;
|
||||
DataBuffer dataBuffer = this.dataBufferFactory.allocateBuffer(read);
|
||||
|
||||
Reference in New Issue
Block a user