File Coverage

blib/lib/Net/SFTP/Buffer.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             # $Id: Buffer.pm,v 1.12 2005/01/16 21:36:56 dbrobins Exp $
2              
3             package Net::SFTP::Buffer;
4 2     2   14 use strict;
  2         3  
  2         48  
5              
6 2     2   903 use Net::SSH::Perl::Buffer;
  2         2302  
  2         50  
7 2     2   12 use base qw( Net::SSH::Perl::Buffer );
  2         4  
  2         166  
8              
9 2     2   1605 use Math::Int64 qw( net_to_int64 int64_to_net );
  0            
  0            
10              
11             sub new {
12             return shift->SUPER::new(@_);
13             }
14              
15             sub get_int64 {
16             my $buf = shift;
17             my $off = defined $_[0] ? shift : $buf->{offset};
18             $buf->{offset} += 8;
19             net_to_int64( $buf->bytes($off, 8) );
20             }
21              
22             sub put_int64 {
23             my $buf = shift;
24             $buf->{buf} .= int64_to_net($_[0]);
25             }
26              
27             sub get_attributes {
28             my $buf = shift;
29             Net::SFTP::Attributes->new(Buffer => $buf);
30             }
31              
32             sub put_attributes {
33             my $buf = shift;
34             $buf->{buf} .= $_[0]->as_buffer->bytes;
35             }
36              
37             1;
38             __END__