Class: Ole::Storage::AllocationTable::Big

Inherits:
Ole::Storage::AllocationTable show all
Defined in:
lib/ole/storage.rb

Constant Summary

Constants inherited from Ole::Storage::AllocationTable

AVAIL, BAT, EOC, META_BAT

Instance Attribute Summary

Attributes inherited from Ole::Storage::AllocationTable

#block_size, #io, #ole

Instance Method Summary collapse

Methods inherited from Ole::Storage::AllocationTable

#[]=, #chain, #free_block, #load, #open, #ranges, #read, #resize_chain, #to_s, #truncate, #truncate!

Constructor Details

#initialize(*args) ⇒ Big

Returns a new instance of Big.



591
592
593
594
595
# File 'lib/ole/storage.rb', line 591

def initialize(*args)
	super
	@block_size = 1 << @ole.header.b_shift
	@io = @ole.io
end

Instance Method Details

#blocks_to_ranges(blocks, size) ⇒ Object

Big blocks are kind of -1 based, in order to not clash with the header.



598
599
600
# File 'lib/ole/storage.rb', line 598

def blocks_to_ranges blocks, size
	super blocks.map { |b| b + 1 }, size
end