Skip to content

Commit df41d46

Browse files
committed
Tidyup unused bytes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/imaging/trunk@1763975 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0644734 commit df41d46

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ protected List<IptcRecord> parseIPTCBlock(final byte[] bytes, final boolean verb
245245
// Debug.debug("index", IPTC_TYPE_CREDIT.name);
246246
// }
247247

248-
final IptcRecord element = new IptcRecord(iptcType, recordData, value);
248+
final IptcRecord element = new IptcRecord(iptcType, value);
249249
elements.add(element);
250250
}
251251

src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcRecord.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,26 @@
1616
*/
1717
package org.apache.commons.imaging.formats.jpeg.iptc;
1818

19-
import java.io.UnsupportedEncodingException;
2019
import java.util.Comparator;
2120

2221
/*
2322
* Represents an IPTC record, a single key-value pair of Photoshop IPTC data.
2423
*/
2524
public class IptcRecord {
2625
public final IptcType iptcType;
27-
private final byte[] bytes;
28-
public final String value;
26+
private final String value;
2927
public static final Comparator<IptcRecord> COMPARATOR = new Comparator<IptcRecord>() {
3028
@Override
3129
public int compare(final IptcRecord e1, final IptcRecord e2) {
3230
return e1.iptcType.getType() - e2.iptcType.getType();
3331
}
3432
};
3533

36-
public IptcRecord(final IptcType iptcType, final byte[] bytes, final String value) {
37-
this.iptcType = iptcType;
38-
this.bytes = bytes; // TODO clone? no point cloning in getRawBytes if not also done here
39-
this.value = value;
40-
}
41-
4234
public IptcRecord(final IptcType iptcType, final String value) {
4335
this.iptcType = iptcType;
44-
byte[] tempBytes;
45-
try {
46-
tempBytes = value.getBytes("ISO-8859-1");
47-
} catch (final UnsupportedEncodingException cannotHappen) {
48-
tempBytes = null;
49-
}
50-
this.bytes = tempBytes;
5136
this.value = value;
5237
}
5338

54-
public byte[] getRawBytes() {
55-
return bytes.clone();
56-
}
57-
5839
public String getValue() {
5940
return value;
6041
}

0 commit comments

Comments
 (0)