|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSHeader
public final class FSHeader
The FSHeader class can be used to quickly decode the header information in a flash file to get information about the number of frames, screen size etc. Only the first few bytes are decoded so this avoid the cost of using the FSMovie class which decodes all the data structures. However if a file is compressed then the entire contents will have to be unzipped first in order to decode the header information. Note: The coordinate system used for the screen extends from the TOP LEFT corner with the positive x-axis extending to the left and the positive y-axis extending DOWN, unlike "traditional" Cartesian systems. The (minX, minY) and (maxX, maxY) coordinates specify the range of values used for the x and y axes. (minX, minY) is often (0,0) but may contain any positive or negative values.
Constructor Summary | |
---|---|
FSHeader(byte[] bytes)
Create a new FSHeader object and initialize it with the information decoded from the binary data. |
|
FSHeader(java.io.File file)
Create a new FSHeader object and initialize it with the information decoded from the Flash file. |
|
FSHeader(java.lang.String filename)
Create a new FSHeader object and initialize it with the information decoded from the Flash file. |
Method Summary | |
---|---|
void |
decodeFromData(byte[] bytes)
Initialize the FSHeader object with binary flash data. |
void |
decodeFromFile(java.io.File file)
Initialize the FSHeader object with the specified flash file. |
void |
decodeFromFile(java.lang.String fileName)
Initialize the FSHeader object with the specified flash file. |
float |
getFrameRate()
Return the number of frames per second at which the Flash Player will attempt to display the file. |
int |
getLength()
Return the length in bytes of the file when uncompressed. |
int |
getMaxX()
Return the x-coordinate of the bottom right corner of the screen. |
int |
getMaxY()
The y-coordinate of the bottom right corner of the screen. |
int |
getMinX()
Return the x-coordinate of the top left corner of the screen. |
int |
getMinY()
The y-coordinate of the top left corner of the screen. |
int |
getNumberOfFrames()
Return the number of frames in the movie. |
java.lang.String |
getSignature()
Return the signature used to identify the file type: "FWS" ("SWF" in reverse) for regular Flash files or "CWS" for compressed (zipped) Flash files. |
int |
getVersion()
Return the version number of Flash format used n the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FSHeader(java.lang.String filename) throws java.io.IOException, java.util.zip.DataFormatException
filename
- the path to a file.
java.io.FileNotFoundException
- if the file referenced by the path does not exist or refers
to a directory.
java.io.IOException
- if there is an error reading the file.
java.util.zip.DataFormatException
- if the file is not a flash file or there is an error
unzipping a compressed flash file.public FSHeader(java.io.File file) throws java.io.IOException, java.util.zip.DataFormatException
file
- a File containing the abstract path to a file.
java.io.FileNotFoundException
- if the file referenced by the path does not exist or refers
to a directory.
java.io.IOException
- if there is an error reading the file.
java.util.zip.DataFormatException
- if the file is not a flash file or there is an error
unzipping a compressed flash file.public FSHeader(byte[] bytes) throws java.io.IOException, java.util.zip.DataFormatException
bytes
- the encoded binary data from a Flash file.
java.util.zip.DataFormatException
- if the data is not in the flash format or there is an error
unzipping the data if it is compressed.
java.io.IOException
Method Detail |
---|
public java.lang.String getSignature()
public int getVersion()
public int getLength()
public int getMinX()
public int getMaxX()
public int getMinY()
public int getMaxY()
public float getFrameRate()
public int getNumberOfFrames()
public void decodeFromFile(java.lang.String fileName) throws java.io.IOException, java.util.zip.DataFormatException
fileName
- the path to a file.
java.io.FileNotFoundException
- if the file referenced by the path does not exist or refers
to a directory.
java.io.IOException
- if there is an error reading the file.
java.util.zip.DataFormatException
- if the file is not a flash file or there is an error
unzipping a compressed flash file.public void decodeFromFile(java.io.File file) throws java.io.IOException, java.util.zip.DataFormatException
file
- a File containing the abstract path to a file.
java.io.FileNotFoundException
- if the file referenced by the path does not exist or refers
to a directory.
java.io.IOException
- if there is an error reading the file.
java.util.zip.DataFormatException
- if the file is not a flash file or there is an error
unzipping a compressed flash file.public void decodeFromData(byte[] bytes) throws java.util.zip.DataFormatException
bytes
- the encoded binary data from a Flash file.
java.util.zip.DataFormatException
- if the data is not in the flash format or there is an error
unzipping the data if it is compressed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |