From 788dd3f03ced7fad0649160d74fd92e9915a0bd1 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 19 Feb 2022 12:08:48 +0000 Subject: refactor some stream code git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898213 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/poi/stress/XSSFBFileHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'poi-integration/src/test') 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 { -- cgit v1.2.3