AMF-Perl
view release on metacpan or search on metacpan
lib/AMF/Perl/IO/OutputStream.pm view on Meta::CPAN
# write the string chars
$self->{outBuffer} .= $s;
}
sub writeDouble
{
my ($self, $d)=@_;
# pack the bytes
my $b = pack("d", $d);
my @b = split //, $b;
# atleast on *nix the bytes have to be reversed
# maybe not on windows, in php there in not flag to
# force whether the bytes are little or big endian
# for a double
my $r = "";
# reverse the bytes
if ($self->{byteorder} eq 'little-endian')
{
for(my $byte = 7 ; $byte >= 0 ; $byte--)
{
$r .= $b[$byte];
( run in 1.035 second using v1.01-cache-2.11-cpan-39bf76dae61 )