public boolean nextRawKey(DataInputBuffer key) throws IOException {
try {
if (!positionToNextRecord(memDataIn)) {
return false;
}
// Setup the key
int pos = memDataIn.getPosition();
byte[] data = memDataIn.getData();
key.reset(data, pos, currentKeyLength);
// Position for the next value
long skipped = memDataIn.skip(currentKeyLength);
if (skipped != currentKeyLength) {
throw new IOException("Rec# " + recNo +
": Failed to skip past key of length: " +
currentKeyLength);
}
// Record the byte
bytesRead += currentKeyLength;
return true;
} catch (IOException ioe) {
dumpOnError();
throw ioe;
}
}
InMemoryReader.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:hadoop
作者:
评论列表
文章目录