java.lang.Object
com.anotherbigidea.flash.writers.SWFWriter
- All Implemented Interfaces:
- com.anotherbigidea.flash.interfaces.SWFFileSignature, com.anotherbigidea.flash.interfaces.SWFHeader, com.anotherbigidea.flash.interfaces.SWFTags
- public class SWFWriter
- extends java.lang.Object
- implements com.anotherbigidea.flash.interfaces.SWFTags, com.anotherbigidea.flash.interfaces.SWFFileSignature
Implements the SWFTags interface and writes a SWF file to the output stream
|
Method Summary |
protected void |
finish()
Finish writing |
void |
header(int version,
long length,
int twipsWidth,
int twipsHeight,
int frameRate,
int frameCount)
Writes the header unless the length or framecount are unknown (as
signified by a negative value), in which case the header values are
stored and written later, when the unknown value(s) can be determined. |
void |
setCompression(boolean compressionOn)
Set Flash MX+ zip-compression on or off. |
void |
signature(java.lang.String sig)
Sets the file signature if it has not been set already. |
void |
tag(int tagType,
boolean longTag,
byte[] contents)
A SWF tag. |
protected void |
writeHeader(int version,
long length,
int frameRate,
int frameCount)
|
private void |
writeSignature()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mOut
protected com.anotherbigidea.io.OutStream mOut
mOutputstream
protected java.io.OutputStream mOutputstream
mByteout
protected java.io.ByteArrayOutputStream mByteout
mSignature
protected java.lang.String mSignature
frameCount
protected int frameCount
version
protected int version
frameSize
protected com.anotherbigidea.flash.structs.Rect frameSize
height
protected int height
rate
protected int rate
SWFWriter
public SWFWriter(java.lang.String filename)
throws java.io.IOException
- Write to a file.
SWFWriter
public SWFWriter(java.io.OutputStream outputstream)
- Write to an output stream - closing it at the end.
SWFWriter
public SWFWriter(com.anotherbigidea.io.OutStream outstream)
- Write to an out stream - closing it at the end.
signature
public void signature(java.lang.String sig)
- Sets the file signature if it has not been set already.
The setCompression(..) method calls this and thus prevents any further
changes to the signature - overriding any signature passed down from the
SWFReader.
- Specified by:
signature in interface com.anotherbigidea.flash.interfaces.SWFFileSignature
setCompression
public void setCompression(boolean compressionOn)
- Set Flash MX+ zip-compression on or off.
It sets the file signature and thus prevents any different signature
from being specified. Only the first call to this method has any effect,
and only if signature(..) has not been called yet.
header
public void header(int version,
long length,
int twipsWidth,
int twipsHeight,
int frameRate,
int frameCount)
throws java.io.IOException
- Writes the header unless the length or framecount are unknown (as
signified by a negative value), in which case the header values are
stored and written later, when the unknown value(s) can be determined.
- Specified by:
header in interface com.anotherbigidea.flash.interfaces.SWFHeader
tag
public void tag(int tagType,
boolean longTag,
byte[] contents)
throws java.io.IOException
- Description copied from interface:
com.anotherbigidea.flash.interfaces.SWFTags
- A SWF tag.
- Specified by:
tag in interface com.anotherbigidea.flash.interfaces.SWFTags
writeHeader
protected void writeHeader(int version,
long length,
int frameRate,
int frameCount)
throws java.io.IOException
writeSignature
private void writeSignature()
throws java.io.IOException
finish
protected void finish()
throws java.io.IOException
- Finish writing