lib/slowfat/data.rb
##
# Return the contents of all clusters in given chain
# @param chain [Integer] the chain of clusters to obtain data from
# @param size [Integer] the total size of data to obtain
Return the contents of all clusters in given chain
Return the contents of all clusters in given chain
def cluster_chain_contents(chain:, size:)
      data = ""
      chain.each_index do |idx|
        cluster = chain[idx]
        read_size = @cluster_size
        read_size = size % @cluster_size if idx == chain.length-1
        data += cluster_contents(cluster: cluster, size: read_size)
      end
      data
    end
def cluster_chain_contents ( chain : , size : ) data = "" chain . each_index do | idx | cluster = chain [ idx ] read_size = @cluster_size read_size = size % @cluster_size if idx == chain . length - 1 data += cluster_contents ( cluster : cluster , size : read_size ) end data end
Return the contents of all clusters in given chain
Return the contents of all clusters in given chain
# read the whole cluster by default # on the last cluster of the file, read only as many # bytes as we need to get the rest of the file, skip the padding
chain
the chain of clusters to obtain data from
the chain of clusters to obtain data from
size
the total size of data to obtain
the total size of data to obtain