mirror of https://github.com/apache/poi.git
[bug-65184] Improve performance of POFSMiniStore getBlockAt. Thanks to sits
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5758145ce8
commit
c70b649e73
|
@ -1,4 +1,3 @@
|
|||
|
||||
/* ====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -35,8 +34,7 @@ import org.apache.poi.poifs.storage.HeaderBlock;
|
|||
* This class handles the MiniStream (small block store)
|
||||
* in the NIO case for {@link POIFSFileSystem}
|
||||
*/
|
||||
public class POIFSMiniStore extends BlockStore
|
||||
{
|
||||
public class POIFSMiniStore extends BlockStore {
|
||||
private final POIFSFileSystem _filesystem;
|
||||
private POIFSStream _mini_stream;
|
||||
private final List<BATBlock> _sbat_blocks;
|
||||
|
@ -44,8 +42,7 @@ public class POIFSMiniStore extends BlockStore
|
|||
private final RootProperty _root;
|
||||
|
||||
POIFSMiniStore(POIFSFileSystem filesystem, RootProperty root,
|
||||
List<BATBlock> sbats, HeaderBlock header)
|
||||
{
|
||||
List<BATBlock> sbats, HeaderBlock header) {
|
||||
this._filesystem = filesystem;
|
||||
this._sbat_blocks = sbats;
|
||||
this._header = header;
|
||||
|
@ -93,7 +90,8 @@ public class POIFSMiniStore extends BlockStore
|
|||
if (!firstInStore) {
|
||||
try {
|
||||
return getBlockAt(offset);
|
||||
} catch(NoSuchElementException ignored) {}
|
||||
} catch (NoSuchElementException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
// Need to extend the stream
|
||||
|
|
Loading…
Reference in New Issue