aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples/src/main/java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-06-08 08:53:08 +0000
committerDominik Stadler <centic@apache.org>2023-06-08 08:53:08 +0000
commitd3e35e740a593027a1105e6509c0aadaa54399b0 (patch)
tree4f9c5b276aa7a088def6aaa7282bb37c39b16105 /poi-examples/src/main/java
parentc8f9fe4c2c01aa896c80de7b43725788b4ce6c4a (diff)
downloadpoi-d3e35e740a593027a1105e6509c0aadaa54399b0.tar.gz
poi-d3e35e740a593027a1105e6509c0aadaa54399b0.zip
Remove deprecation warnings reported with newer commons-io
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910300 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples/src/main/java')
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawing.java2
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CustomXMLMapping.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawing.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawing.java
index 2cefd3d87f..c3a5b8c400 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawing.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawing.java
@@ -192,7 +192,7 @@ public final class OfficeDrawing {
private static int loadPicture( String path, HSSFWorkbook wb ) throws IOException {
int pictureIndex;
try (FileInputStream fis = new FileInputStream(path);
- UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream()) {
+ UnsynchronizedByteArrayOutputStream bos = UnsynchronizedByteArrayOutputStream.builder().get()) {
IOUtils.copy(fis, bos);
pictureIndex = wb.addPicture(bos.toByteArray(), Workbook.PICTURE_TYPE_PNG);
}
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CustomXMLMapping.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CustomXMLMapping.java
index edba46bba3..e1a912e734 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CustomXMLMapping.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CustomXMLMapping.java
@@ -38,7 +38,7 @@ public final class CustomXMLMapping {
for (XSSFMap map : wb.getCustomXMLMappings()) {
XSSFExportToXml exporter = new XSSFExportToXml(map);
- UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream();
+ UnsynchronizedByteArrayOutputStream os = UnsynchronizedByteArrayOutputStream.builder().get();
exporter.exportToXML(os, true);
String xml = os.toString(StandardCharsets.UTF_8);
System.out.println(xml);