src: update IndexedStorageFile
This commit is contained in:
@@ -451,6 +451,10 @@ public class IndexedStorageFile implements Closeable {
|
||||
blobHeaderBuffer = this.readBlobHeader(firstSegmentIndex);
|
||||
srcLength = blobHeaderBuffer.getInt(SRC_LENGTH_OFFSET);
|
||||
int compressedLength = blobHeaderBuffer.getInt(COMPRESSED_LENGTH_OFFSET);
|
||||
// Handle empty chunks (newly generated with no data)
|
||||
if (compressedLength == 0 && srcLength == 0) {
|
||||
return allocateDirect(0);
|
||||
}
|
||||
src = this.readSegments(firstSegmentIndex, compressedLength);
|
||||
break label43;
|
||||
}
|
||||
@@ -486,6 +490,10 @@ public class IndexedStorageFile implements Closeable {
|
||||
ByteBuffer blobHeaderBuffer = this.readBlobHeader(firstSegmentIndex);
|
||||
srcLength = blobHeaderBuffer.getInt(SRC_LENGTH_OFFSET);
|
||||
int compressedLength = blobHeaderBuffer.getInt(COMPRESSED_LENGTH_OFFSET);
|
||||
// Handle empty chunks (newly generated with no data)
|
||||
if (compressedLength == 0 && srcLength == 0) {
|
||||
return;
|
||||
}
|
||||
if (srcLength > dest.remaining()) {
|
||||
throw new IllegalArgumentException("dest buffer is not large enough! required dest.remaining() >= " + srcLength);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user