Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.flagstone.transform
Class FSHeader

    java.lang.Object
      com.flagstone.transform.FSHeader

    public final class FSHeader

extends java.lang.Object

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

### FSHeader

    public FSHeader(java.lang.String filename)
             throws java.io.IOException,
                    java.util.zip.DataFormatException

  Create a new FSHeader object and initialize it with the information decoded from the Flash file.

  Parameters:
    `filename` - the path to a file.
  Throws:
    `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.

### FSHeader

    public FSHeader(java.io.File file)
             throws java.io.IOException,
                    java.util.zip.DataFormatException

  Create a new FSHeader object and initialize it with the information decoded from the Flash file.

  Parameters:
    `file` - a File containing the abstract path to a file.
  Throws:
    `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.

### FSHeader

    public FSHeader(byte[] bytes)
             throws java.io.IOException,
                    java.util.zip.DataFormatException

  Create a new FSHeader object and initialize it with the information decoded from the binary data.

  Parameters:
    `bytes` - the encoded binary data from a Flash file.
  Throws:
    `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

### getSignature

    public 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.

  Returns:
    the signature used to identify the file as a Flash file.

### getVersion

    public int getVersion()

  Return the version number of Flash format used n the file.

  Returns:
    the Flash version number

### getLength

    public int getLength()

  Return the length in bytes of the file when uncompressed.

  Returns:
    the length of the (uncompressed) file in bytes.

### getMinX

    public int getMinX()

  Return the x-coordinate of the top left corner of the screen.

  Returns:
    the x-coordinate of the top left corner

### getMaxX

    public int getMaxX()

  Return the x-coordinate of the bottom right corner of the screen.

  Returns:
    the x-coordinate of the bottom right corner

### getMinY

    public int getMinY()

  The y-coordinate of the top left corner of the screen.

  Returns:
    the y-coordinate of the top left corner

### getMaxY

    public int getMaxY()

  The y-coordinate of the bottom right corner of the screen.

  Returns:
    the y-coordinate of the bottom right corner

### getFrameRate

    public float getFrameRate()

  Return the number of frames per second at which the Flash Player will attempt to display the file.

  Returns:
    the frame rate in frames per second.

### getNumberOfFrames

    public int getNumberOfFrames()

  Return the number of frames in the movie.

  Returns:
    the number of frames in the movie

### decodeFromFile

    public void decodeFromFile(java.lang.String fileName)
                        throws java.io.IOException,
                               java.util.zip.DataFormatException

  Initialize the FSHeader object with the specified flash file.

  Parameters:
    `fileName` - the path to a file.
  Throws:
    `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.

### decodeFromFile

    public void decodeFromFile(java.io.File file)
                        throws java.io.IOException,
                               java.util.zip.DataFormatException

  Initialize the FSHeader object with the specified flash file.

  Parameters:
    `file` - a File containing the abstract path to a file.
  Throws:
    `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.

### decodeFromData

    public void decodeFromData(byte[] bytes)
                        throws java.util.zip.DataFormatException

  Initialize the FSHeader object with binary flash data.

  Parameters:
    `bytes` - the encoded binary data from a Flash file.
  Throws:
    `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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD