Sha256: 5b51a4eb7e120cb3a29873653227765430546e09e31e6b519403b1d20f515a17
Contents?: true
Size: 739 Bytes
Versions: 66
Compression:
Stored size: 739 Bytes
Contents
module Ext3 class AllocBitmap def initialize(data) raise "Ext3::AllocBitmap.initialize: Nil data" if data.nil? @data = data end def isAllocated?(number) getStatus(number) end def [](number) getStatus(number) end def dump @data.hex_dump end private def getStatus(number) byte, mask = index(number) @data[byte] & mask == mask end def index(number) byte, bit = number.divmod(8) if byte > @data.size - 1 msg = "AllocBitmap#index: " msg += "byte index #{byte} is out of range for data[0:#{@data.size - 1}]" raise msg end mask = 128 >> bit return byte, mask end end # class end # module
Version data entries
66 entries across 66 versions & 1 rubygems