BioMart::Web Zlib
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Carp
Compress::Raw::Zlib
Compress::Zlib
Fcntl qw ( SEEK_SET )
IO::Compress::Gzip
Symbol
Tie::Handle
Inherit
Tie::Handle
Synopsis
No synopsis!
Description
No description!
Methods
AUTOLOAD
No description
Code
CLOSE
No description
Code
DESTROY
No description
Code
EOF
No description
Code
OPEN
No description
Code
READ
No description
Code
READLINE
No description
Code
TIEHANDLE
No description
Code
WRITE
No description
Code
new
No description
Code
Methods description
None available.
Methods code
AUTOLOADdescriptionprevnextTop
sub AUTOLOAD {
    my $self = shift;

    $AUTOLOAD =~ s/.*:://;
    $AUTOLOAD =~ tr/a-z/A-Z/;

    return tied(*{$self})->$AUTOLOAD(@_);
}

1;
}
CLOSEdescriptionprevnextTop
sub CLOSE {
    my $self = shift;

    return undef unless defined($self->{'gz'});

    my $output = '';
    my $status = $self->{'gz'}->flush(\$output);
    my $fileh = $self->{'fileh'};
    print $fileh $output.pack("V V", $self->{'gz'}->crc32(), $self->{'gz'}->total_in());

    delete $self->{'gz'};
    delete $self->{'fileh'};

    return ($status == Compress::Zlib::Z_OK) ? 1 : undef;
}
DESTROYdescriptionprevnextTop
sub DESTROY {
}
EOFdescriptionprevnextTop
sub EOF {
}
OPENdescriptionprevnextTop
sub OPEN {
    my $self = shift;
    my $fileh = shift;

    $self->{'fileh'} = $fileh;
    $self->{'gz'} = new Compress::Raw::Zlib::Deflate(
                      -AppendOutput  => 1,
                      -CRC32         => 1,
                      -ADLER32       => 0,
                      -Level         => Z_BEST_COMPRESSION(),
                      -WindowBits    => - MAX_WBITS(),
                     )
	or croak "$self: Cannot create deflation streami\n";
    binmode $fileh;
    print $fileh IO::Compress::Gzip::GZIP_MINIMUM_HEADER ;

    return defined($self->{'gz'}) ? $self : undef;
}
READdescriptionprevnextTop
sub READ {
}
READLINEdescriptionprevnextTop
sub READLINE {
}
TIEHANDLEdescriptionprevnextTop
sub TIEHANDLE {
    my $class = shift;
    my @args = @_;

    my $self = bless {}, $class;

    return @args ? $self->OPEN(@args) : $self;
}
WRITEdescriptionprevnextTop
sub WRITE {
    my $self = shift;
    my $buf = shift;
    my $length = shift;
    my $offset = shift;

    $self->OPEN unless $self->{'gz'};

    croak "BioMart::Zlib::WRITE: too long LENGTH" unless $length <= length($buf);
    croak "BioMart::Zlib::WRITE: OFFSET not supported" if defined($offset) && $offset != 0;

    my $data = substr($buf,0,$length);
    my $output = '';
    my $status = $self->{'gz'}->deflate($data,\$output);
    my $fileh = $self->{'fileh'};
    print $fileh $output;
    return ($status==Compress::Zlib::Z_OK) ? $length : undef;
}
newdescriptionprevnextTop
sub new {
    my $class = shift;
    my @args = @_;

    my $self = gensym();

    tie *{$self}, $class, @args;

    return tied(${$self}) ? bless $self, $class : undef;
}
General documentation
No general documentation available.