public class JpegSegmentData extends Object implements Serializable
| Constructor and Description |
|---|
JpegSegmentData() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSegment(byte segmentMarker,
byte[] segmentBytes)
Adds segment bytes to the collection.
|
boolean |
containsSegment(byte segmentMarker)
Determines whether data is present for a given segment marker.
|
static JpegSegmentData |
fromFile(File file)
Deserialises the contents of a JpegSegmentData from a file.
|
byte[] |
getSegment(byte segmentMarker)
Gets the first Jpeg segment data for the specified marker.
|
byte[] |
getSegment(byte segmentMarker,
int occurrence)
Gets segment data for a specific occurrence and marker.
|
int |
getSegmentCount(byte segmentMarker)
Returns the count of segment data byte arrays stored for a given segment marker.
|
List<byte[]> |
getSegmentList(byte segmentMarker) |
Iterable<byte[]> |
getSegments(byte segmentMarker)
Returns all instances of a given Jpeg segment.
|
void |
removeSegment(byte segmentMarker)
Removes all segments from the collection having the specified marker.
|
void |
removeSegmentOccurrence(byte segmentMarker,
int occurrence)
Removes a specified instance of a segment's data from the collection.
|
static void |
toFile(File file,
JpegSegmentData segmentData)
Serialises the contents of a JpegSegmentData to a file.
|
public void addSegment(byte segmentMarker,
byte[] segmentBytes)
segmentMarker - segmentBytes - public byte[] getSegment(byte segmentMarker)
segmentMarker - the byte identifier for the desired segmentpublic byte[] getSegment(byte segmentMarker,
int occurrence)
segmentMarker - identifies the required segmentoccurrence - the zero-based index of the occurrencepublic Iterable<byte[]> getSegments(byte segmentMarker)
segmentMarker - a number which identifies the type of Jpeg segment being queriedpublic List<byte[]> getSegmentList(byte segmentMarker)
public int getSegmentCount(byte segmentMarker)
segmentMarker - identifies the required segmentpublic void removeSegmentOccurrence(byte segmentMarker,
int occurrence)
segmentMarker - identifies the required segmentoccurrence - the zero-based index of the segment occurrence to remove.public void removeSegment(byte segmentMarker)
segmentMarker - identifies the required segmentpublic boolean containsSegment(byte segmentMarker)
segmentMarker - identifies the required segmentpublic static void toFile(File file, JpegSegmentData segmentData) throws IOException
file - to file to write fromsegmentData - the data to writeIOException - if problems occur while writingpublic static JpegSegmentData fromFile(File file) throws IOException, ClassNotFoundException
file - the file to read fromIOException - if problems occur while readingClassNotFoundException - if problems occur while deserialisingCopyright © 2003-2012 Drew Noakes. All Rights Reserved.