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:
parent
61bf6a25b7
commit
d8f4d37624
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue