com.flagstone.transform
Class MovieObject

java.lang.Object
  extended by com.flagstone.transform.MovieObject
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class MovieObject
extends Object
implements MovieTag

MovieObject is used to represent any object decoded from a Movie that is not directly supported by Transform.

This allow a certain amount of forward compatibility where file which use a version of Flash greater than the one supported by Transform can be decoded and encoded.


Constructor Summary
MovieObject(int aType, byte[] bytes)
          Creates and initialises a MovieObject object using the specified type and encoded data.
MovieObject(MovieObject object)
          Creates and initialises a MovieObject object using the values copied from another MovieObject object.
MovieObject(SWFDecoder coder)
          Creates and initialises a MovieObject object using values encoded in the Flash binary format.
 
Method Summary
 MovieObject copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 byte[] getData()
          Get a copy of the encoded data for the movie tag object.
 int getType()
          Get the type that identifies the object when it is encoded.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MovieObject

public MovieObject(SWFDecoder coder)
            throws IOException
Creates and initialises a MovieObject object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

MovieObject

public MovieObject(int aType,
                   byte[] bytes)
Creates and initialises a MovieObject object using the specified type and encoded data.

Parameters:
aType - the type that identifies the MovieTag when it is encoded.
bytes - the encoded bytes that form the body of the object.

MovieObject

public MovieObject(MovieObject object)
Creates and initialises a MovieObject object using the values copied from another MovieObject object.

Parameters:
object - a MovieObject object from which the values will be copied.
Method Detail

getType

public int getType()
Get the type that identifies the object when it is encoded.

Returns:
the type that identifies the encoded data structure.

getData

public byte[] getData()
Get a copy of the encoded data for the movie tag object.

Returns:
a copy of the encoded data.

copy

public MovieObject copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.