sub data {
my $self = shift;
- my $chain_loc = $self->chain_loc;
+ my $data;
+ while ( 1 ) {
+ my $chain_loc = $self->chain_loc;
- my $data = $self->engine->storage->read_at(
- $self->offset + 2 + $self->engine->byte_size + 1, $self->data_length,
- );
+ $data .= $self->engine->storage->read_at(
+ $self->offset + 2 + $self->engine->byte_size + 1, $self->data_length,
+ );
- if ( $chain_loc ) {
- $data .= $self->engine->_load_sector( $chain_loc )->data;
+ last unless $chain_loc;
+
+ $self = $self->engine->_load_sector( $chain_loc );
}
return $data;