aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src
diff options
context:
space:
mode:
authorAxel Howind <axh@apache.org>2022-01-10 14:37:13 +0000
committerAxel Howind <axh@apache.org>2022-01-10 14:37:13 +0000
commit78f7decf00a5a3b8f075222464879aa6d8b9ce48 (patch)
tree76e468273a99f57fa1e658246dfd840cf315f2e1 /poi-scratchpad/src
parent1533af4f1d33af8a8fd74b4d6af92f0bc0fa3901 (diff)
downloadpoi-78f7decf00a5a3b8f075222464879aa6d8b9ce48.tar.gz
poi-78f7decf00a5a3b8f075222464879aa6d8b9ce48.zip
Bug 65796: License violation in PICT.java
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896887 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
index 864bce2b2c..8ae0496e4f 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
@@ -23,6 +23,7 @@ import java.awt.Dimension;
import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.IOException;
+import java.util.Arrays;
import java.util.zip.InflaterInputStream;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
@@ -99,7 +100,7 @@ public final class PICT extends Metafile {
out.write(chunk, 0, count);
// PICT zip-stream can be erroneous, so we clear the array to determine
// the maximum of read bytes, after the inflater crashed
- bytefill(chunk, (byte) 0);
+ Arrays.fill(chunk, (byte) 0);
}
} catch (Exception e) {
int lastLen = chunk.length - 1;
@@ -186,22 +187,4 @@ public final class PICT extends Metafile {
throw new IllegalArgumentException(signature+" is not a valid instance/signature value for PICT");
}
}
-
-
- /*
- * initialize a smaller piece of the array and use the System.arraycopy
- * call to fill in the rest of the array in an expanding binary fashion
- */
- private static void bytefill(byte[] array, byte value) {
- // http://stackoverflow.com/questions/9128737/fastest-way-to-set-all-values-of-an-array
- int len = array.length;
-
- if (len > 0){
- array[0] = value;
- }
-
- for (int i = 1; i < len; i += i) {
- System.arraycopy(array, 0, array, i, Math.min(len - i, i));
- }
- }
}