aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-03-14 23:54:49 +0000
committerPJ Fanning <fanningpj@apache.org>2021-03-14 23:54:49 +0000
commit9078e982c30947478211781aeb096e5f45bd3300 (patch)
treeebe2f1544a518c6794ca399ded618f182ba04ee8 /src
parent093fa9adb10b6443616bd84346ef7eb190786d51 (diff)
downloadpoi-9078e982c30947478211781aeb096e5f45bd3300.tar.gz
poi-9078e982c30947478211781aeb096e5f45bd3300.zip
[bug-65184] revert due to integration test failures
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/poifs/filesystem/POIFSMiniStore.java26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/java/org/apache/poi/poifs/filesystem/POIFSMiniStore.java b/src/java/org/apache/poi/poifs/filesystem/POIFSMiniStore.java
index 623bd99467..9df110ed2d 100644
--- a/src/java/org/apache/poi/poifs/filesystem/POIFSMiniStore.java
+++ b/src/java/org/apache/poi/poifs/filesystem/POIFSMiniStore.java
@@ -54,32 +54,28 @@ public class POIFSMiniStore extends BlockStore {
/**
* Load the block at the given offset.
*/
- protected ByteBuffer getBlockAt(final int offset) {
+ protected ByteBuffer getBlockAt(final int offset) throws IOException {
// Which big block is this?
int byteOffset = offset * POIFSConstants.SMALL_BLOCK_SIZE;
int bigBlockNumber = byteOffset / _filesystem.getBigBlockSize();
int bigBlockOffset = byteOffset % _filesystem.getBigBlockSize();
// Now locate the data block for it
- Iterator<Integer> it = _mini_stream.getBlockOffsetIterator();
+ Iterator<ByteBuffer> it = _mini_stream.getBlockIterator();
for (int i = 0; i < bigBlockNumber; i++) {
it.next();
}
- try {
- ByteBuffer dataBlock = _filesystem.getBlockAt(it.next());
- assert(dataBlock != null);
+ ByteBuffer dataBlock = it.next();
+ assert(dataBlock != null);
- // Position ourselves, and take a slice
- dataBlock.position(
- dataBlock.position() + bigBlockOffset
- );
- ByteBuffer miniBuffer = dataBlock.slice();
- miniBuffer.limit(POIFSConstants.SMALL_BLOCK_SIZE);
- return miniBuffer;
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ // Position ourselves, and take a slice
+ dataBlock.position(
+ dataBlock.position() + bigBlockOffset
+ );
+ ByteBuffer miniBuffer = dataBlock.slice();
+ miniBuffer.limit(POIFSConstants.SMALL_BLOCK_SIZE);
+ return miniBuffer;
}
/**