aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Volkhart <mariusvolkhart@apache.org>2021-03-01 00:37:11 +0000
committerMarius Volkhart <mariusvolkhart@apache.org>2021-03-01 00:37:11 +0000
commita134b9abb3f0b468618f4b4e2c9e4ccf2665ac5e (patch)
treeeff135d3ac237dc8ed5514708b3e12d9c806177f /src
parent8ab53c6489bf86f9be47a1f599558b689d2cda26 (diff)
downloadpoi-a134b9abb3f0b468618f4b4e2c9e4ccf2665ac5e.tar.gz
poi-a134b9abb3f0b468618f4b4e2c9e4ccf2665ac5e.zip
Improve performance of HSLFPictureData#write
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887022 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
index 5b418f98c3..7f9b54eb09 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
@@ -237,23 +237,13 @@ public abstract class HSLFPictureData implements PictureData, GenericRecord {
* Write this picture into <code>OutputStream</code>
*/
public void write(OutputStream out) throws IOException {
- byte[] data;
+ LittleEndian.putUShort(getSignature(), out);
- data = new byte[LittleEndianConsts.SHORT_SIZE];
- LittleEndian.putUShort(data, 0, getSignature());
- out.write(data);
-
- data = new byte[LittleEndianConsts.SHORT_SIZE];
PictureType pt = getType();
- LittleEndian.putUShort(data, 0, pt.nativeId + EscherRecordTypes.BLIP_START.typeID);
- out.write(data);
+ LittleEndian.putUShort(pt.nativeId + EscherRecordTypes.BLIP_START.typeID, out);
byte[] rd = getRawData();
-
- data = new byte[LittleEndianConsts.INT_SIZE];
- LittleEndian.putInt(data, 0, rd.length);
- out.write(data);
-
+ LittleEndian.putInt(rd.length, out);
out.write(rd);
}