Sha256: 6ae7b5a894f709a77fa5492ddb0e25f2358c1a32aadaa05efeba0f9cfc51090e
Contents?: true
Size: 739 Bytes
Versions: 66
Compression:
Stored size: 739 Bytes
Contents
module Ext4 class AllocBitmap def initialize(data) raise "Ext4::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