org.freehep.graphicsio.swf
Class SWFInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.freehep.util.io.DecompressableInputStream
          extended by org.freehep.util.io.BitInputStream
              extended by org.freehep.util.io.ByteOrderInputStream
                  extended by org.freehep.util.io.ByteCountInputStream
                      extended by org.freehep.util.io.TaggedInputStream
                          extended by org.freehep.graphicsio.swf.SWFInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, SWFConstants

public class SWFInputStream
extends org.freehep.util.io.TaggedInputStream
implements SWFConstants

This class extends the TaggedInputStream with several methods to read SWF primitives from the stream and to read TagHeaders. It also handles the management of the SWFDictionary.

Version:
$Id: SWFInputStream.java 9979 2006-11-27 22:51:07Z duns $
Author:
Mark Donszelmann, Charles Loomis

Field Summary
 
Fields inherited from class org.freehep.util.io.TaggedInputStream
actionSet, tagSet
 
Fields inherited from class org.freehep.util.io.ByteOrderInputStream
little
 
Fields inherited from class org.freehep.util.io.BitInputStream
BIT_MASK, FIELD_MASK, MASK_SIZE, ONES, ZERO
 
Fields inherited from interface org.freehep.graphicsio.swf.SWFConstants
CONTROL, DEFAULT_VERSION, DEFINITION, LANGUAGE_JAPANESE, LANGUAGE_KOREAN, LANGUAGE_LATIN, LANGUAGE_SIMPLIFIED_CHINESE, LANGUAGE_TRADITIONAL_CHINESE, TWIPS
 
Constructor Summary
SWFInputStream(java.io.InputStream is)
           
SWFInputStream(java.io.InputStream is, int version)
           
SWFInputStream(java.io.InputStream is, SWFSpriteTagSet tagSet, SWFActionSet actionSet)
           
 
Method Summary
 SWFDictionary getDictionary()
           
 byte[] getJPEGTable()
           
 int getVersion()
           
protected  org.freehep.util.io.ActionHeader readActionHeader()
           
 java.awt.Color readColor(boolean alpha)
          Read an RGB value from the stream.
 float readFixed()
          Read a fixed point value (16.16).
 float readFixed8()
          Read a fixed point value (8.8).
 SWFHeader readHeader()
           
 int readLanguageCode()
           
 java.awt.geom.AffineTransform readMatrix()
          Read a matrix from the stream.
 java.awt.geom.Rectangle2D readRect()
          Read a rectangle from the stream.
 java.lang.String readString()
          Read a string from the stream.
protected  org.freehep.util.io.TagHeader readTagHeader()
           
 void setJPEGTable(byte[] table)
           
 
Methods inherited from class org.freehep.util.io.TaggedInputStream
addAction, addTag, getTagHeader, readAction, readTag
 
Methods inherited from class org.freehep.util.io.ByteCountInputStream
getLength, popBuffer, pushBuffer, read
 
Methods inherited from class org.freehep.util.io.ByteOrderInputStream
readAsciiZString, readBoolean, readByte, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readInt, readLine, readLong, readShort, readShort, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedShort, readUnsignedShort, readUTF, skipBytes
 
Methods inherited from class org.freehep.util.io.BitInputStream
byteAlign, fetchByte, readBitFlag, readFBits, readSBits, readUBits
 
Methods inherited from class org.freehep.util.io.DecompressableInputStream
skip, startDecompressing
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWFInputStream

public SWFInputStream(java.io.InputStream is)
               throws java.io.IOException
Throws:
java.io.IOException

SWFInputStream

public SWFInputStream(java.io.InputStream is,
                      int version)
               throws java.io.IOException
Throws:
java.io.IOException

SWFInputStream

public SWFInputStream(java.io.InputStream is,
                      SWFSpriteTagSet tagSet,
                      SWFActionSet actionSet)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

readFixed

public float readFixed()
                throws java.io.IOException
Read a fixed point value (16.16).

Throws:
java.io.IOException

readFixed8

public float readFixed8()
                 throws java.io.IOException
Read a fixed point value (8.8).

Throws:
java.io.IOException

readRect

public java.awt.geom.Rectangle2D readRect()
                                   throws java.io.IOException
Read a rectangle from the stream.

Throws:
java.io.IOException

readColor

public java.awt.Color readColor(boolean alpha)
                         throws java.io.IOException
Read an RGB value from the stream.

Throws:
java.io.IOException

readMatrix

public java.awt.geom.AffineTransform readMatrix()
                                         throws java.io.IOException
Read a matrix from the stream.

Throws:
java.io.IOException

readString

public java.lang.String readString()
                            throws java.io.IOException
Read a string from the stream.

Overrides:
readString in class org.freehep.util.io.ByteOrderInputStream
Throws:
java.io.IOException

readLanguageCode

public int readLanguageCode()
                     throws java.io.IOException
Throws:
java.io.IOException

readTagHeader

protected org.freehep.util.io.TagHeader readTagHeader()
                                               throws java.io.IOException
Specified by:
readTagHeader in class org.freehep.util.io.TaggedInputStream
Throws:
java.io.IOException

readActionHeader

protected org.freehep.util.io.ActionHeader readActionHeader()
                                                     throws java.io.IOException
Specified by:
readActionHeader in class org.freehep.util.io.TaggedInputStream
Throws:
java.io.IOException

readHeader

public SWFHeader readHeader()
                     throws java.io.IOException
Throws:
java.io.IOException

getDictionary

public SWFDictionary getDictionary()

setJPEGTable

public void setJPEGTable(byte[] table)

getJPEGTable

public byte[] getJPEGTable()

getVersion

public int getVersion()


Copyright © 2000-2007 FreeHEP. All Rights Reserved.