SWF::BinStream::Codec - Document for SWF::BinStream codecs.
use SWF::BinStream; .... $stream->add_codec('Foo'); ---- package SWF::BinStream::Codec::Foo; $VERSION='x.xx'; package SWF::BinStream::Codec::Foo::Read; sub new {} sub decode {} sub close {} package SWF::BinStream::Codec::Foo::Write; sub new {} sub encode {} sub close {} 1;
SWF::BinStream:Codec::* package provides additive codecs for SWF::BinStream.
The whole package name must be 'SWF::BinStream::Codec::[name]'. SWF::BinStream use the package when its add_codec method is called with the name. Two sub package, 'SWF::BinStream::Codec::[name]::Read' and 'SWF::BinStream::Codec::[name]::Write' should contain the package.
The codec class must equip these methods. Each method should die when error occurs.
should return a new decoder. It does not take any parameters.
is called with the data read from the stream. It should return decoded data.
is called when the stream is closed. It does not take any parameters.
should return a new encoder. It does not take any parameters.
is called with the data to write to the stream. It should return encoded data.
is called when the stream is to be closed. It is called with the rest of bufferred data. It should return encoded data.
Copyright 2002 Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install SWF::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SWF::File
CPAN shell
perl -MCPAN -e shell install SWF::File
For more information on module installation, please visit the detailed CPAN module installation guide.