All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.util.EndianDescriptor
java.lang.Object
|
+----quicktime.util.EndianDescriptor
- public class EndianDescriptor
- extends Object
An EndianDescriptor is used to describe the flipping requirements of a
particular data-structure. It has three modes which are determined by the
format flag which is provided in the constructor:
- kFlipSpecifiedFields is used when describing an object where either
only some of the data should be flipped or the fields are different sizes
and thus should be flipped according to their size. Only when a descriptor is in
this state can a profile of the endian requirements be built up using the EndianFlipSpec
class.
- The data is consistent for the entire size of the object, in which case
the format describes the size of the flipping that should be applied
- The data should NOT be flipped at all
An application can build EndianDescriptor objects for any custom data structures
that require endian flipping for consistency between platforms with different endian
orders and data files (like the QuickTime Movie File) that generally require data
to have a particular endian format.
The EndianDescriptor objects is used with the QTUtils.endianFlip calls or the platform
sensitive EndianOrder.flip... methods.
-
flipAll16
- This object is used to describe data that should be flipped around 16bit size.
-
flipAll32
- This object is used to describe data that should be flipped around 32bit size.
-
flipAll64
- This object is used to describe data that should be flipped around 64bit size.
-
kFlipAllFields16
- Describes the modal state of the EndianDescriptor object.
-
kFlipAllFields32
- Describes the modal state of the EndianDescriptor object.
-
kFlipAllFields64
- Describes the modal state of the EndianDescriptor object.
-
kFlipNoFields
- Describes the modal state of the EndianDescriptor object.
-
kFlipSpecifiedFields
- Describes the modal state of the EndianDescriptor object.
-
EndianDescriptor(int)
- Create an EndianDescriptor class with the supplied format.
-
addFlipSpec(EndianFlipSpec)
- An EndianDescriptor with the format kFlipSpecifiedFields, typically describes
data that is not contiguous in size of location.
-
flipSpecs()
- Returns an Enumeration to iterate over the collection of EndianFlipSpecs
or null if there is no collection to iterate over
-
getFlipSpec(int)
- Returns an EndianFlipSpec at the specified offset, or null if no
flip spec is found in the collection at that offset.
-
getFormatFlag()
- Returns the format of the EndianDescriptor object - which determines the
behaviour of the descriptor when used with the endianFlip methods.
-
removeFlipSpec(EndianFlipSpec)
- Removes a specified EndianFlipSpec (if found) from the EndianDescriptor.
-
toString()
- Return a String representation of this object.
kFlipSpecifiedFields
public static final int kFlipSpecifiedFields
- Describes the modal state of the EndianDescriptor object. Only when
an EndianDescriptor's format is kFlipSpecifiedFields can EndianFlipSpec
objects be added
kFlipAllFields16
public static final int kFlipAllFields16
- Describes the modal state of the EndianDescriptor object. Only when
an EndianDescriptor's format is kFlipSpecifiedFields can EndianFlipSpec
objects be added
kFlipAllFields32
public static final int kFlipAllFields32
- Describes the modal state of the EndianDescriptor object. Only when
an EndianDescriptor's format is kFlipSpecifiedFields can EndianFlipSpec
objects be added
kFlipAllFields64
public static final int kFlipAllFields64
- Describes the modal state of the EndianDescriptor object. Only when
an EndianDescriptor's format is kFlipSpecifiedFields can EndianFlipSpec
objects be added
kFlipNoFields
public static final int kFlipNoFields
- Describes the modal state of the EndianDescriptor object. Only when
an EndianDescriptor's format is kFlipSpecifiedFields can EndianFlipSpec
objects be added
flipAll16
public static final EndianDescriptor flipAll16
- This object is used to describe data that should be flipped around 16bit size.
flipAll32
public static final EndianDescriptor flipAll32
- This object is used to describe data that should be flipped around 32bit size.
flipAll64
public static final EndianDescriptor flipAll64
- This object is used to describe data that should be flipped around 64bit size.
EndianDescriptor
public EndianDescriptor(int formatFlag)
- Create an EndianDescriptor class with the supplied format.
- Parameters:
- formatFlag - specifies the mode of the EndianDescriptor object.
getFormatFlag
public int getFormatFlag()
- Returns the format of the EndianDescriptor object - which determines the
behaviour of the descriptor when used with the endianFlip methods.
- Returns:
- an int
addFlipSpec
public void addFlipSpec(EndianFlipSpec spec)
- An EndianDescriptor with the format kFlipSpecifiedFields, typically describes
data that is not contiguous in size of location. As such a more complex
description of the flipping requirements of this data must be built, and
the addition of EndianFlipSpecs is used to describe these requirements.
In this case an EndianDescriptor becomes a collection of EndianFlipSpec objects
that completely describe the flipping requirements of the target data object.
EndianFlipSpecs are ordered in an EndianDescriptor by the offset of these
EndianFlipSpecs. When a candidate EndianFlipSpec is added to an EndianDescriptor
object it will only be added if it's offset is unique in the descriptor's collection
of flip spec members. If the offset already exists in the collection the new object is
not added and an exception is thrown.
If and only if the format of the EndianDescriptor is kFlipSpecifiedFields
can an EndianFlipSpec be added to the EndianDescriptor.
- Parameters:
- spec - the new spec to add to the EndianDescriptor's collection.
removeFlipSpec
public void removeFlipSpec(EndianFlipSpec member)
- Removes a specified EndianFlipSpec (if found) from the EndianDescriptor.
getFlipSpec
public EndianFlipSpec getFlipSpec(int offset)
- Returns an EndianFlipSpec at the specified offset, or null if no
flip spec is found in the collection at that offset.
- Parameters:
- offset - the offset of the desired EndianFlipSpec
- Returns:
- the EndianFlipSpec with the specified offset value or null if no
spec with that offset value
flipSpecs
public Enumeration flipSpecs()
- Returns an Enumeration to iterate over the collection of EndianFlipSpecs
or null if there is no collection to iterate over
toString
public String toString()
- Return a String representation of this object.
- Returns:
- a String
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index