File: Wrapper.pm

package info (click to toggle)
libdata-parsebinary-perl 0.31~dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 440 kB
  • sloc: perl: 4,386; makefile: 2
file content (41 lines) | stat: -rwxr-xr-x 1,366 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use strict;
use warnings;

package Data::ParseBinary::Stream::WrapperReader;
our @ISA = qw{Data::ParseBinary::Stream::Reader Data::ParseBinary::Stream::WrapperBase};

__PACKAGE__->_registerStreamType("Wrap");

sub new {
    my ($class, $sub_stream) = @_;
    my $self = bless { }, $class;
    $self->_warping($sub_stream);
    return $self;
}

sub ReadBytes { my $self = shift; $self->{ss}->ReadBytes(@_);  }
sub ReadBits { my $self = shift; $self->{ss}->ReadBits(@_); }
sub isBitStream { my $self = shift; $self->{ss}->isBitStream(@_); }
sub seek { my $self = shift; $self->{ss}->seek(@_); }
sub tell { my $self = shift; $self->{ss}->tell(@_); }

package Data::ParseBinary::Stream::WrapperWriter;
our @ISA = qw{Data::ParseBinary::Stream::Writer Data::ParseBinary::Stream::WrapperBase};

__PACKAGE__->_registerStreamType("Wrap");

sub new {
    my ($class, $sub_stream) = @_;
    my $self = bless { }, $class;
    $self->_warping($sub_stream);
    return $self;
}

sub WriteBytes { my $self = shift; $self->{ss}->WriteBytes(@_);  }
sub WriteBits { my $self = shift; $self->{ss}->WriteBits(@_); }
sub Flush { my $self = shift; return $self->{ss} }
sub isBitStream { my $self = shift; $self->{ss}->isBitStream(@_); }
sub seek { my $self = shift; $self->{ss}->seek(@_); }
sub tell { my $self = shift; $self->{ss}->tell(@_); }

1;