#182 Massive refactorings to clean up metadata and segment handling

This commit is contained in:
Harald Kuhr
2016-08-23 21:21:58 +02:00
parent 15ce9d6b64
commit 673f3e5b53
31 changed files with 1315 additions and 449 deletions
@@ -53,11 +53,15 @@ public final class JPEGSegment implements Serializable {
this.length = length;
}
int segmentLength() {
public int segmentLength() {
// This is the length field as read from the stream
return length;
}
public InputStream segmentData() {
return data != null ? new ByteArrayInputStream(data) : null;
}
public int marker() {
return marker;
}
@@ -106,7 +106,7 @@ public final class JPEGSegmentUtil {
if (isRequested(segment, segmentIdentifiers)) {
if (segments == Collections.EMPTY_LIST) {
segments = new ArrayList<JPEGSegment>();
segments = new ArrayList<>();
}
segments.add(segment);