public class JpegSegmentData
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
JpegSegmentData()
Creates a new JpegSegmentData collection object.
|
| 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(java.io.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.
|
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(java.io.File file,
JpegSegmentData segmentData)
Serialises the contents of a JpegSegmentData to a file.
|
public JpegSegmentData()
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 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(java.io.File file,
JpegSegmentData segmentData)
throws java.io.IOException
file - to file to write fromsegmentData - the data to writejava.io.IOException - if problems occur while writingpublic static JpegSegmentData FromFile(java.io.File file) throws java.io.IOException, java.lang.ClassNotFoundException
file - the file to read fromjava.io.IOException - if problems occur while readingjava.lang.ClassNotFoundException - if problems occur while deserialisingCopyright © 2006 Drew Noakes. All Rights Reserved.