In fastForward, shown below, the code is intended to read 16k buffers, but it doesn't.
The code length $offset is returning the number of bytes in the string re[presentation of the number stored in $offset. So if $offset contains the number 1234, it will get converted to the string "1234" when length is called. That string contains 4 bytes.
sub fastForward {
my $self = shift;
my $offset = shift;
my $buffer = '';
my $c = 1024 * 16;
while ($offset > 0) {
$c = length $offset
if length $offset < $c ;
$offset -= $c;
$self->smartReadExact(\$buffer, $c)
or return 0;
}
return 1;
}
In
fastForward, shown below, the code is intended to read 16k buffers, but it doesn't.The code
length $offsetis returning the number of bytes in the string re[presentation of the number stored in$offset. So if$offsetcontains the number 1234, it will get converted to the string "1234" whenlengthis called. That string contains 4 bytes.