org.apache.portals.gems.flash
Class SWFHeader

java.lang.Object
  extended by org.apache.portals.gems.flash.SWFHeader

public class SWFHeader
extends Object

Author:
brooks

Field Summary
static String COMPRESSED
           
private  String compressionType
           
private  int frameCount
           
private  int frameRate
           
private  int height
           
protected  org.apache.commons.logging.Log log
           
private  int nbits
           
private  String signature
           
private  long size
           
static String UNCOMPRESSED
           
private  int version
           
private  int width
           
private  int xmax
           
private  int ymax
           
 
Constructor Summary
SWFHeader()
           
 
Method Summary
 int convertPixelsToTwips(int pixels)
           
 int convertTwipsToPixels(int twips)
           
private  boolean doParseHeader(InputStream is)
           
 void dumpHeaderToStdOut()
           
 String getCompressionType()
           
 int getFrameCount()
           
 int getFrameRate()
           
 int getHeight()
           
 int getNbits()
           
 String getSignature()
           
 long getSize()
           
 int getVersion()
           
 int getWidth()
           
 int getXmax()
           
 int getYmax()
           
 boolean isCompressed()
           
 boolean isCompressed(int firstByte)
           
 boolean isSWF(byte[] signature)
           
static void main(String[] args)
           
private  boolean manageInputStreamAndParseHeader(InputStream is, File file)
           
 boolean parseHeader(File file)
           
 boolean parseHeader(InputStream is)
           
 boolean parseHeader(String fileName)
           
 void read(byte[] output, byte[] input, int offset)
           
 PackedBitObj readPackedBits(byte[] bytes, int byteMarker, int bitMarker, int length)
           
 int readSize(byte[] bytes)
           
 byte[] strip(byte[] bytes)
           
protected  byte[] uncompressHeader(byte[] bytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

COMPRESSED

public static final String COMPRESSED
See Also:
Constant Field Values

UNCOMPRESSED

public static final String UNCOMPRESSED
See Also:
Constant Field Values

signature

private String signature

compressionType

private String compressionType

version

private int version

size

private long size

nbits

private int nbits

xmax

private int xmax

ymax

private int ymax

width

private int width

height

private int height

frameRate

private int frameRate

frameCount

private int frameCount
Constructor Detail

SWFHeader

public SWFHeader()
Method Detail

parseHeader

public boolean parseHeader(String fileName)

parseHeader

public boolean parseHeader(File file)

parseHeader

public boolean parseHeader(InputStream is)

manageInputStreamAndParseHeader

private boolean manageInputStreamAndParseHeader(InputStream is,
                                                File file)

doParseHeader

private boolean doParseHeader(InputStream is)
                       throws Exception
Throws:
Exception

read

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

readPackedBits

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

isCompressed

public boolean isCompressed()

uncompressHeader

protected byte[] uncompressHeader(byte[] bytes)
                           throws DataFormatException
Throws:
DataFormatException

readSize

public int readSize(byte[] bytes)

strip

public byte[] strip(byte[] bytes)

main

public static void main(String[] args)
Parameters:
args -

dumpHeaderToStdOut

public void dumpHeaderToStdOut()

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


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.