FreeHEP API
Version current

org.freehep.graphicsio.swf
Class SWFInputStream

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

public class SWFInputStream
extends 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,v 1.6 2005/02/28 06:55:58 duns Exp $
Author:
Mark Donszelmann, Charles Loomis
Source Code:
SWFInputStream.java

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(InputStream is)
           
SWFInputStream(InputStream is, int version)
           
SWFInputStream(InputStream is, SWFSpriteTagSet tagSet, SWFActionSet actionSet)
           
 
Method Summary
 SWFDictionary getDictionary()
           
 byte[] getJPEGTable()
           
 int getVersion()
           
protected  ActionHeader readActionHeader()
          Decodes and returns the ActionHeader, which includes an actionCode and a length
 Color readColor(boolean alpha)
          Read an RGB value from the stream.
 float readFixed()
          Read a fixed point value (16.16).
 SWFHeader readHeader()
           
 int readLanguageCode()
           
 AffineTransform readMatrix()
          Read a matrix from the stream.
 Rectangle2D readRect()
          Read a rectangle from the stream.
 String readString()
          Read a string from the stream.
protected  TagHeader readTagHeader()
          Decodes and returns the TagHeader, which includes a TagID and a length
 void setJPEGTable(byte[] table)
           
 
Methods inherited from class org.freehep.util.io.TaggedInputStream
addAction, addTag, 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(InputStream is)
               throws IOException

SWFInputStream

public SWFInputStream(InputStream is,
                      int version)
               throws IOException

SWFInputStream

public SWFInputStream(InputStream is,
                      SWFSpriteTagSet tagSet,
                      SWFActionSet actionSet)
               throws IOException
Method Detail

readFixed

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

Throws:
IOException

readRect

public Rectangle2D readRect()
                     throws IOException
Read a rectangle from the stream.

Throws:
IOException

readColor

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

Throws:
IOException

readMatrix

public AffineTransform readMatrix()
                           throws IOException
Read a matrix from the stream.

Throws:
IOException

readString

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

Overrides:
readString in class ByteOrderInputStream
Throws:
IOException

readLanguageCode

public int readLanguageCode()
                     throws IOException
Throws:
IOException

readTagHeader

protected TagHeader readTagHeader()
                           throws IOException
Description copied from class: TaggedInputStream
Decodes and returns the TagHeader, which includes a TagID and a length

Specified by:
readTagHeader in class TaggedInputStream
Throws:
IOException

readActionHeader

protected ActionHeader readActionHeader()
                                 throws IOException
Description copied from class: TaggedInputStream
Decodes and returns the ActionHeader, which includes an actionCode and a length

Specified by:
readActionHeader in class TaggedInputStream
Throws:
IOException

readHeader

public SWFHeader readHeader()
                     throws IOException
Throws:
IOException

getDictionary

public SWFDictionary getDictionary()

setJPEGTable

public void setJPEGTable(byte[] table)

getJPEGTable

public byte[] getJPEGTable()

getVersion

public int getVersion()

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.