Documentation ¶
Overview ¶
Package swf contains utilities to read Shockwave Flash Format files It provides a Parser to parse an entire Swf file. It also provides a Reader implementation that can read basic data types defined by the specification (see http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf-file-format-spec.pdf)
Index ¶
Constants ¶
const ( CompressionNone = iota CompressionZlib CompressionLZMA // Currently not implemented )
These represent possible Swf compression algorithm
const ( CodeTagEnd = 0 // CodeTagEnd is the code representing a Tag of type End CodeTagDoABC = 82 // CodeTagDoABC is the code representing a Tag of type DoABC )
These represent code of handled Swf tags
Variables ¶
var ErrMalformedHeader = errors.New("malformed header")
ErrMalformedHeader means that the swf file header is malformed. The signature is malformed
var ErrUnsupportedFile = errors.New("unsupported file")
ErrUnsupportedFile means that the swf file is not supported. The file is compressed with an unsupported algorithm
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { Compression uint8 Version uint8 FileLength uint32 FrameSize Rect FrameRate float32 FrameCount uint16 }
Header represents a Swf file's header
type Parser ¶
Parser is the minimal interface for parsing a Swf file
func NewParser ¶
func NewParser(origin io.ReadSeeker) Parser
NewParser provides a simple way to create a Swf file
type Reader ¶
type Reader interface { io.Reader io.Seeker ReadByte() (byte, error) ReadBits(n uint) (uint32, error) ReadInt8() (int8, error) ReadInt16() (int16, error) ReadInt32() (int32, error) ReadUInt8() (uint8, error) ReadUInt16() (uint16, error) ReadUInt32() (uint32, error) ReadEUInt32() (uint32, error) ReadBitValue(n uint8) (int32, error) ReadUBitValue(n uint8) (uint32, error) ReadFixed() (float32, error) ReadFixed8() (float32, error) ReadString() (string, error) }
Reader is the minimal interface required to read a swf
func NewReader ¶
func NewReader(r io.ReadSeeker) Reader
NewReader provides a simple way to create a Reader from a given io.Reader