org.riotfamily.common.util
Class FlashInfo

java.lang.Object
  extended by org.riotfamily.common.util.FlashInfo

public class FlashInfo
extends Object

Author:
brooks

Nested Class Summary
 class FlashInfo.PackedBitObj
           
 
Field Summary
static String COMPRESSED
           
protected  RiotLog log
           
static String UNCOMPRESSED
           
 
Constructor Summary
FlashInfo(File file)
           
 
Method Summary
 byte[] compress(byte[] bytes, int length)
           
 int convertPixelsToTwips(int pixels)
           
 int convertTwipsToPixels(int twips)
           
 byte[] decompress(byte[] bytes)
           
 String getCompressionType()
           
 int getFrameCount()
           
 int getFrameRate()
           
 int getHeight()
           
 int getNbits()
           
 String getSignature()
           
 long getSize()
           
 int getVersion()
           
 int getWidth()
           
 int getXmax()
           
 int getYmax()
           
 boolean isCompressed(int firstByte)
           
 boolean isSWF(byte[] signature)
           
 boolean isValid()
           
 boolean parseHeader(File file)
           
 void read(byte[] output, byte[] input, int offset)
           
 FlashInfo.PackedBitObj readPackedBits(byte[] bytes, int byteMarker, int bitMarker, int length)
           
 int readSize(byte[] bytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected RiotLog log

COMPRESSED

public static String COMPRESSED

UNCOMPRESSED

public static String UNCOMPRESSED
Constructor Detail

FlashInfo

public FlashInfo(File file)
          throws IOException
Throws:
IOException
Method Detail

parseHeader

public boolean parseHeader(File file)
                    throws IOException
Throws:
IOException

read

public void read(byte[] output,
                 byte[] input,
                 int offset)

readSize

public int readSize(byte[] bytes)

readPackedBits

public FlashInfo.PackedBitObj readPackedBits(byte[] bytes,
                                             int byteMarker,
                                             int bitMarker,
                                             int length)

convertTwipsToPixels

public int convertTwipsToPixels(int twips)

convertPixelsToTwips

public int convertPixelsToTwips(int pixels)

isSWF

public boolean isSWF(byte[] signature)

isCompressed

public boolean isCompressed(int firstByte)

compress

public byte[] compress(byte[] bytes,
                       int length)

decompress

public byte[] decompress(byte[] bytes)
                  throws DataFormatException
Throws:
DataFormatException

getFrameCount

public int getFrameCount()
Returns:
the frameCount

getFrameRate

public int getFrameRate()
Returns:
the frameRate

getNbits

public int getNbits()
Returns:
the nbits

getSignature

public String getSignature()
Returns:
the signature

getSize

public long getSize()
Returns:
the size

getVersion

public int getVersion()
Returns:
the version

getXmax

public int getXmax()
Returns:
the xmax

getYmax

public int getYmax()
Returns:
the ymax

getCompressionType

public String getCompressionType()
Returns:
the compressionType

getHeight

public int getHeight()
Returns:
the height

getWidth

public int getWidth()
Returns:
the width

isValid

public boolean isValid()
Returns:
true if no exception occured during parsing