Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.anotherbigidea.flash.readers
Class SWFReader  view SWFReader download SWFReader.java

java.lang.Object
  extended bycom.anotherbigidea.flash.readers.SWFReader

public class SWFReader
extends java.lang.Object

Reads a SWF input stream and drives the SWFTags interface. Automatically decompresses the file if necessary.


Field Summary
protected  boolean mCompressed
           
protected  com.anotherbigidea.flash.interfaces.SWFTags mConsumer
           
protected  java.lang.String mFilename
           
protected  com.anotherbigidea.io.InStream mIn
           
protected  java.io.InputStream mInputstream
           
 
Constructor Summary
SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer, java.io.InputStream inputstream)
           
SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer, com.anotherbigidea.io.InStream instream)
           
SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer, java.lang.String filename)
          Read from a file.
 
Method Summary
static void main(java.lang.String[] args)
          Test: read from args[0] and write to args[1].
 void readFile()
          Drive the consumer by reading a SWF File - including the header and all tags
 void readHeader()
          Read the SWF file header - including the signature.
 int readOneTag()
          Drive the consumer by reading one tag
 void readRemainderOfHeader()
          Read the header after the signature.
 void readSignature()
          Read and verify just the file signature.
 void readTags()
          Drive the consumer by reading SWF tags only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConsumer

protected com.anotherbigidea.flash.interfaces.SWFTags mConsumer

mIn

protected com.anotherbigidea.io.InStream mIn

mInputstream

protected java.io.InputStream mInputstream

mCompressed

protected boolean mCompressed

mFilename

protected java.lang.String mFilename
Constructor Detail

SWFReader

public SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer,
                 java.lang.String filename)
          throws java.io.IOException
Read from a file. Must call readFile() in order to properly close the file.


SWFReader

public SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer,
                 java.io.InputStream inputstream)

SWFReader

public SWFReader(com.anotherbigidea.flash.interfaces.SWFTags consumer,
                 com.anotherbigidea.io.InStream instream)
Method Detail

readFile

public void readFile()
              throws java.io.IOException
Drive the consumer by reading a SWF File - including the header and all tags


readTags

public void readTags()
              throws java.io.IOException
Drive the consumer by reading SWF tags only. The full header must have been read prior to this.


readOneTag

public int readOneTag()
               throws java.io.IOException
Drive the consumer by reading one tag


readSignature

public void readSignature()
                   throws java.io.IOException
Read and verify just the file signature.


readHeader

public void readHeader()
                throws java.io.IOException
Read the SWF file header - including the signature.


readRemainderOfHeader

public void readRemainderOfHeader()
                           throws java.io.IOException
Read the header after the signature. The signature must have been read prior to this.


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Test: read from args[0] and write to args[1]. If args[2] is '+' then output is forced to be compressed, if it is '-' then output is forced to be uncompressed - otherwise the output is the same as the input.