GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SWF::BinStream::Codec(3) User Contributed Perl Documentation SWF::BinStream::Codec(3)

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.

SWF::BinStream::[name]::Read

SWF::BinStream::[name]::Read->new;
should return a new decoder. It does not take any parameters.
$codec->decode( $data );
is called with the data read from the stream. It should return decoded data.
$codec->close;
is called when the stream is closed. It does not take any parameters.

SWF::BinStream::[name]::Write

SWF::BinStream::[name]::Write->new;
should return a new encoder. It does not take any parameters.
$codec->encode( $data );
is called with the data to write to the stream. It should return encoded data.
$codec->close( $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.

2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.