aboutsummaryrefslogtreecommitdiffstats
path: root/poi-integration/src/test
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-02-19 12:08:48 +0000
committerPJ Fanning <fanningpj@apache.org>2022-02-19 12:08:48 +0000
commit788dd3f03ced7fad0649160d74fd92e9915a0bd1 (patch)
treecb6c0aaa0bb2b3e0de295479b9d88319a913f35a /poi-integration/src/test
parent4998436a00da6816d76ca31862ff2274ee9f53ce (diff)
downloadpoi-788dd3f03ced7fad0649160d74fd92e9915a0bd1.tar.gz
poi-788dd3f03ced7fad0649160d74fd92e9915a0bd1.zip
refactor some stream code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898213 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration/src/test')
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/XSSFBFileHandler.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/XSSFBFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/XSSFBFileHandler.java
index b8a247524f..f60752d6dd 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/XSSFBFileHandler.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/XSSFBFileHandler.java
@@ -16,12 +16,12 @@
==================================================================== */
package org.apache.poi.stress;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import org.apache.commons.io.input.UnsynchronizedByteArrayInputStream;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackageAccess;
import org.apache.poi.util.IOUtils;
@@ -41,11 +41,11 @@ public class XSSFBFileHandler extends AbstractFileHandler {
public void handleFile(InputStream stream, String path) throws Exception {
byte[] bytes = IOUtils.toByteArray(stream);
- try (OPCPackage opcPackage = OPCPackage.open(new ByteArrayInputStream(bytes))) {
+ try (OPCPackage opcPackage = OPCPackage.open(new UnsynchronizedByteArrayInputStream(bytes))) {
testOne(opcPackage);
}
- testNotHandledByWorkbookException(OPCPackage.open(new ByteArrayInputStream(bytes)));
+ testNotHandledByWorkbookException(OPCPackage.open(new UnsynchronizedByteArrayInputStream(bytes)));
}
private void testNotHandledByWorkbookException(OPCPackage pkg) throws IOException {