HDFS-10795. Fix an error in ReaderStrategy#ByteBufferStrategy. Contributed by Sammi Chen
This commit is contained in:
parent
81485dbfc1
commit
f4a21d3aba
@ -181,7 +181,7 @@ public int readFromBlock(BlockReader blockReader,
|
|||||||
int length) throws IOException {
|
int length) throws IOException {
|
||||||
ByteBuffer tmpBuf = readBuf.duplicate();
|
ByteBuffer tmpBuf = readBuf.duplicate();
|
||||||
tmpBuf.limit(tmpBuf.position() + length);
|
tmpBuf.limit(tmpBuf.position() + length);
|
||||||
int nRead = blockReader.read(readBuf.slice());
|
int nRead = blockReader.read(tmpBuf);
|
||||||
// Only when data are read, update the position
|
// Only when data are read, update the position
|
||||||
if (nRead > 0) {
|
if (nRead > 0) {
|
||||||
readBuf.position(readBuf.position() + nRead);
|
readBuf.position(readBuf.position() + nRead);
|
||||||
|
Loading…
Reference in New Issue
Block a user