|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.drew.imaging.jpeg.JpegSegmentData
public class JpegSegmentData
Holds a collection of Jpeg data segments. This need not necessarily be all segments within the Jpeg. For example, it may be convenient to store only the non-image segments when analysing (or serializing) metadata. Segments are keyed via their segment marker (a byte). Where multiple segments use the same segment marker, they will all be stored and available.
Constructor Summary | |
---|---|
JpegSegmentData()
Creates a new JpegSegmentData collection object. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpegSegmentData()
Method Detail |
---|
public void addSegment(byte segmentMarker, byte[] segmentBytes)
segmentMarker
- segmentBytes
- public byte[] getSegment(byte segmentMarker)
segmentMarker
- the byte identifier for the desired segment
public byte[] getSegment(byte segmentMarker, int occurrence)
segmentMarker
- identifies the required segmentoccurrence
- the zero-based index of the occurrence
public int getSegmentCount(byte segmentMarker)
segmentMarker
- identifies the required segment
public 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 segment
public static void ToFile(java.io.File file, JpegSegmentData segmentData) throws java.io.IOException
file
- to file to write fromsegmentData
- the data to write
java.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 from
java.io.IOException
- if problems occur while reading
java.lang.ClassNotFoundException
- if problems occur while deserialising
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |