diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-08-29 14:41:12 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-08-29 14:41:12 +0000 |
commit | ebdbe8b97ab92fd16bbd687b2b3662d252ef57d6 (patch) | |
tree | 90f352484ed4d1bdff0755c8c33f6bcce9d46ec2 /src/java/org/apache/poi/ddf/EscherBitmapBlip.java | |
parent | 7b5bd4a7f67ce324620153ead02d7bfc90348806 (diff) | |
download | poi-ebdbe8b97ab92fd16bbd687b2b3662d252ef57d6.tar.gz poi-ebdbe8b97ab92fd16bbd687b2b3662d252ef57d6.zip |
- reworked HexDump class - unified array dumps and usage of standard java calls for hex format
- fixed a few findbugs DM_DEFAULT_ENCODING issues
- removed a few System.out/.err calls - instead the poilogger is used
- closed a few left open resource instances
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700040 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/ddf/EscherBitmapBlip.java')
-rw-r--r-- | src/java/org/apache/poi/ddf/EscherBitmapBlip.java | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/java/org/apache/poi/ddf/EscherBitmapBlip.java b/src/java/org/apache/poi/ddf/EscherBitmapBlip.java index d81eebdcc9..096e0c4a87 100644 --- a/src/java/org/apache/poi/ddf/EscherBitmapBlip.java +++ b/src/java/org/apache/poi/ddf/EscherBitmapBlip.java @@ -20,8 +20,6 @@ package org.apache.poi.ddf; import org.apache.poi.util.HexDump; import org.apache.poi.util.LittleEndian; -import java.io.ByteArrayOutputStream; - /** * @author Glen Stampoultzis */ @@ -95,17 +93,8 @@ public class EscherBitmapBlip extends EscherBlipRecord { { String nl = System.getProperty( "line.separator" ); - String extraData; - ByteArrayOutputStream b = new ByteArrayOutputStream(); - try - { - HexDump.dump( this.field_pictureData, 0, b, 0 ); - extraData = b.toString(); - } - catch ( Exception e ) - { - extraData = e.toString(); - } + String extraData = HexDump.dump(this.field_pictureData, 0, 0); + return getClass().getName() + ":" + nl + " RecordId: 0x" + HexDump.toHex( getRecordId() ) + nl + " Version: 0x" + HexDump.toHex( getVersion() ) + nl + @@ -117,17 +106,7 @@ public class EscherBitmapBlip extends EscherBlipRecord { @Override public String toXml(String tab) { - String extraData; - ByteArrayOutputStream b = new ByteArrayOutputStream(); - try - { - HexDump.dump( this.field_pictureData, 0, b, 0 ); - extraData = b.toString(); - } - catch ( Exception e ) - { - extraData = e.toString(); - } + String extraData = HexDump.dump(this.field_pictureData, 0, 0); StringBuilder builder = new StringBuilder(); builder.append(tab).append(formatXmlRecordHeader(getClass().getSimpleName(), HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance()))) .append(tab).append("\t").append("<UID>0x").append(HexDump.toHex(field_1_UID)).append("</UID>\n") |