quicktime.util
Class QTPointerRef

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.util.QTPointerRef
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary
Direct Known Subclasses:
AtomData, CodecName, CodecNameList, EditEntry, ExtScheduledSoundHeader, MediaParams, NewPresentationParams, PresIdleParams, PresParams, QDGraphics, QTGetExternalMovieRecord, QTPointer, QTVector, QTVRInterceptRecord, ResolvedQTEventSpec, SampleReference, SndCommand, StatusParams, TimeRecord

public class QTPointerRef
extends QTObject
implements quicktime.jdirect.QuickTimeLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.InterfaceLib

A QTPointerRef is a "smart" pointer in that it can be either a Reference to a pointer which is not disposable, or it can be a real "independent" pointer which is automatically disposed on finalization.This class is used as a generic base class for pointer based objects. See QTHandle for a user-level pointer object.

The default setting is for the Ptr to be disposable - you must use the QTPointerRef(int, int, Object) constructor to create a non-disposable reference For non-disposable Pointers there are two situations to look out for:
(1) Upon finalization the pointer should NOT be disposed - it belongs to a parent struct
(2) The parent object from which the pointer is obtained should not be allowed to go away whilst the reference object is alive.
In both situations we must maintain a reference to the parent or owner object.


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Method Summary
 void copyFromArray(int ptrOffset, byte[] srcArray, int srcOffset, int length)
          An efficient byte[] copy that copies length bytes from the byte array to the pointer.
 void copyFromArray(int ptrOffset, char[] srcArray, int srcOffset, int length)
          An efficient char[] copy that copies length chars from the char array to the pointer.
 void copyFromArray(int ptrOffset, double[] srcArray, int srcOffset, int length)
          An efficient double[] copy that copies length doubles from the double array to the pointer.
 void copyFromArray(int ptrOffset, float[] srcArray, int srcOffset, int length)
          An efficient float[] copy that copies length floats from the float array to the pointer.
 void copyFromArray(int ptrOffset, int[] srcArray, int srcOffset, int length)
          An efficient int[] copy that copies length ints from the int array to the pointer.
 void copyFromArray(int ptrOffset, long[] srcArray, int srcOffset, int length)
          An efficient long[] copy that copies length longs from the long array to the pointer.
 void copyFromArray(int ptrOffset, short[] srcArray, int srcOffset, int length)
          An efficient short[] copy that copies length shorts from the short array to the pointer.
 void copyToArray(int ptrOffset, byte[] destArray, int destOffset, int length)
          An efficient byte[] copy that copies length bytes from the pointer to the byte array.
 void copyToArray(int ptrOffset, char[] destArray, int destOffset, int length)
          An efficient char[] copy that copies length chars from the pointer to the char array.
 void copyToArray(int ptrOffset, double[] destArray, int destOffset, int length)
          An efficient double[] copy that copies length doubles from the pointer to the double array.
 void copyToArray(int ptrOffset, float[] destArray, int destOffset, int length)
          An efficient float[] copy that copies length floats from the pointer to the float array.
 void copyToArray(int ptrOffset, int[] destArray, int destOffset, int length)
          An efficient int[] copy that copies length ints from the pointer to the int array.
 void copyToArray(int ptrOffset, long[] destArray, int destOffset, int length)
          An efficient long[] copy that copies length longs from the pointer to the long array.
 void copyToArray(int ptrOffset, short[] destArray, int destOffset, int length)
          An efficient short[] copy that copies length shorts from the pointer to the short array.
 byte[] getBytes()
          Returns a copy of the data of the pointer as a byte array
 int getSize()
          Returns the size of the QTPionter
 java.lang.String toString()
          A String representation of the class.
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSize

public int getSize()
Returns the size of the QTPionter

getBytes

public byte[] getBytes()
Returns a copy of the data of the pointer as a byte array
Returns:
a byte array - copy of pointer data

copyToArray

public final void copyToArray(int ptrOffset,
                              byte[] destArray,
                              int destOffset,
                              int length)
An efficient byte[] copy that copies length bytes from the pointer to the byte array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the bytes from
destArray - the destination byte array
destOffset - the offset within the byte array to start copying to
length - the number of bytes to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              short[] destArray,
                              int destOffset,
                              int length)
An efficient short[] copy that copies length shorts from the pointer to the short array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the shorts from
destArray - the destination short array
destOffset - the offset within the short array to start copying to
length - the number of shorts to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              char[] destArray,
                              int destOffset,
                              int length)
An efficient char[] copy that copies length chars from the pointer to the char array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the chars from
destArray - the destination char array
destOffset - the offset within the char array to start copying to
length - the number of chars to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              int[] destArray,
                              int destOffset,
                              int length)
An efficient int[] copy that copies length ints from the pointer to the int array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the ints from
destArray - the destination int array
destOffset - the offset within the int array to start copying to
length - the number of ints to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              float[] destArray,
                              int destOffset,
                              int length)
An efficient float[] copy that copies length floats from the pointer to the float array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the floats from
destArray - the destination float array
destOffset - the offset within the float array to start copying to
length - the number of floats to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              long[] destArray,
                              int destOffset,
                              int length)
An efficient long[] copy that copies length longs from the pointer to the long array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the longs from
destArray - the destination long array
destOffset - the offset within the long array to start copying to
length - the number of longs to copy

copyToArray

public final void copyToArray(int ptrOffset,
                              double[] destArray,
                              int destOffset,
                              int length)
An efficient double[] copy that copies length doubles from the pointer to the double array.
Parameters:
ptrOffset - the byte offset from the pointer to copy the doubles from
destArray - the destination double array
destOffset - the offset within the double array to start copying to
length - the number of doubles to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                byte[] srcArray,
                                int srcOffset,
                                int length)
An efficient byte[] copy that copies length bytes from the byte array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the byte[] to copy
srcOffset - the nth index within the byte [] to start copying from
length - how many elements of the byte array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                short[] srcArray,
                                int srcOffset,
                                int length)
An efficient short[] copy that copies length shorts from the short array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the short[] to copy
srcOffset - the nth index within the short [] to start copying from
length - how many elements of the short array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                char[] srcArray,
                                int srcOffset,
                                int length)
An efficient char[] copy that copies length chars from the char array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the char[] to copy
srcOffset - the nth index within the char [] to start copying from
length - how many elements of the char array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                int[] srcArray,
                                int srcOffset,
                                int length)
An efficient int[] copy that copies length ints from the int array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the int[] to copy
srcOffset - the nth index within the int [] to start copying from
length - how many elements of the int array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                float[] srcArray,
                                int srcOffset,
                                int length)
An efficient float[] copy that copies length floats from the float array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the float[] to copy
srcOffset - the nth index within the float [] to start copying from
length - how many elements of the float array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                long[] srcArray,
                                int srcOffset,
                                int length)
An efficient long[] copy that copies length longs from the long array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the long[] to copy
srcOffset - the nth index within the long [] to start copying from
length - how many elements of the long array to copy

copyFromArray

public final void copyFromArray(int ptrOffset,
                                double[] srcArray,
                                int srcOffset,
                                int length)
An efficient double[] copy that copies length doubles from the double array to the pointer.
Parameters:
ptrOffset - how many bytes offset from the base pointer to copy to.
srcArray - the double[] to copy
srcOffset - the nth index within the double [] to start copying from
length - how many elements of the double array to copy

toString

public java.lang.String toString()
A String representation of the class.
Overrides:
toString in class QTObject