com.flagstone.transform
Class FSCoderException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by com.flagstone.transform.FSCoderException
All Implemented Interfaces:
java.io.Serializable

public class FSCoderException
extends java.io.IOException

This exception is thrown when parse errors are encountered. ParseExceptions contain information about the error that prevented a file from being read and decoded.

See Also:
Serialized Form

Constructor Summary
FSCoderException(int type, int start, int length, int delta, java.lang.String message)
          Constructs an FSCoderException to report where a problem occurred when encoding or decoding a Flash (.swf) file.
 
Method Summary
 int getDelta()
          The difference between the calculated number of bytes and the actual number of bytes when the object was encoded or decoded.
 int getLength()
          The calculated number of bytes the object will occupy when encoded.
 int getStart()
          The byte address of the start of the object in the file being decoded.
 int getType()
          Returns the type identifying the FSMovieObject or FSActionObject that caused the error.
 java.lang.String toString()
          Return a description of the error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FSCoderException

public FSCoderException(int type,
                        int start,
                        int length,
                        int delta,
                        java.lang.String message)
Constructs an FSCoderException to report where a problem occurred when encoding or decoding a Flash (.swf) file.

Parameters:
type - the type of object or action that was being encoded/decoded when the problem occurred.
start - the address in the file where the data structure being encoded/decoded is located. This is only valid for files being decoded since the encoded file will not be written if an exception occurs.
length - the size in bytes that the data structure should take when encoded.
delta - the difference between the actual number of byes and the expected length. This is negative for underflow errors and positive when the takes more bytes to encode/decode that the expected length.
message - a message indicating the type of error - overflow or underflow.
Method Detail

getType

public int getType()
Returns the type identifying the FSMovieObject or FSActionObject that caused the error.

Returns:
the object type.

getStart

public int getStart()
The byte address of the start of the object in the file being decoded. This address is not valid when encoding a Flash file since the file will probably not be encoded - though this is under the control of the software using Transform.

Returns:
the address (offset) in bytes where the object is encoded.

getLength

public int getLength()
The calculated number of bytes the object will occupy when encoded.

Returns:
the length in bytes that the object is expected to occupy when encoded.

getDelta

public int getDelta()
The difference between the calculated number of bytes and the actual number of bytes when the object was encoded or decoded.

Returns:
the difference between the actual and expected number of bytes encoded/decoded.

toString

public java.lang.String toString()
Return a description of the error.

Overrides:
toString in class java.lang.Throwable
Returns:
a string describing the error that caused the exception.