quicktime.util
Class QTByteObject

java.lang.Object
  |
  +--quicktime.util.QTByteObject
All Implemented Interfaces:
quicktime.jdirect.PrimitivesLib, java.io.Serializable, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary
Direct Known Subclasses:
ByteEncodedImage, CameraData, CameraPlacement, CameraRange, CameraViewPort, CodecInfo, ComponentDescription, CompressionInfo, DataRateParams, DataRateSettings, DigitizerInfo, GraphicsMode, GXPath, GXPaths, ICMFrameTime, ICMPixelFormatInfo, InstKnob, InstKnobList, InstSampleDesc, KnobDescription, LevelMeterInfo, Matrix, Matrix3x3, Matrix4x4, MediaEQSpectrumBands, MusicMIDIPacket, NoteRequestInfo, OpenCPicParams, Point3D, QDColor, QDDimension, QDRect, Quaternion, RotateTransformData, ScrpSTElement, SCStatus, SGDeviceName, SoundComponentData, SpatialSettings, SPB, SynthesizerConnections, SynthesizerDescription, TCTextOptions, TemporalSettings, TimeCodeDef, TimeCodeTime, ToneDescription, TuneStatus, TweenData, Vector2D, Vector3D

public class QTByteObject
extends java.lang.Object
implements quicktime.jdirect.PrimitivesLib, java.io.Serializable

Provides a representation of the native data structure as a byte array. The class implements the Serializable interface and can thus be serialized.

However the byte[] member is marked as transient because typically a QTByteObject is used to contain objects that have fields, such as shorts, ints, that are larger than bytes. Moving these objects from big to little to big endian run-time architectures can cause problems if the endian issues of these members are not taken care of by the particular class of the object that is being serialized. Thus, any subclass of QTByteObject that is to be serialized defines custome read and write object methods that will ensure that the serialized data that is written out is in big endian format, and if required will be flipped back to native format when read in.

See Also:
Serialized Form

Fields inherited from interface quicktime.jdirect.PrimitivesLib
JDirect_MacOSX, libraryInstance
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the two objects have the same value.
static QTByteObject fromArray(byte[] ar)
          This call will return a QTByteObject which becomes a proxy for the specified byte array.
 byte[] getBytes()
          Returns the byte array containing the packed native object.
 int getSize()
          Returns the size of the represented native object.
 java.lang.String toString()
          Returns a string representation of this object
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

fromArray

public static QTByteObject fromArray(byte[] ar)
This call will return a QTByteObject which becomes a proxy for the specified byte array. It does not copy the byte array - but references it.
Parameters:
ar - the byte array to represent
Returns:
a QTByteObject with the specified array as its target bytes

getBytes

public final byte[] getBytes()
Returns the byte array containing the packed native object.
Returns:
the actual byte array NOT a copy

getSize

public int getSize()
Returns the size of the represented native object.
Returns:
size

equals

public boolean equals(java.lang.Object obj)
Returns true if the two objects have the same value.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of this object
Overrides:
toString in class java.lang.Object