lib/mcg/signal_analysis/sar_file.rb
# Pack contents to binary and write to file
Pack contents to binary and write to file
Pack contents to binary and write to file
def to_file( f )
          size = 0
          @indexes.each { size += Index::FORMAT_SIZE }
          @idata.each do |i| 
            size += IntData::FORMAT_SIZE
            size += i.data_size
          end
          buf = [@source, @name, @sym, @indexes.length(), @idata.length(), 
                 size].pack(PFORMAT)
          f.write(buf)
          @indexes.each { |i| i.to_file(f) }
          @idata.each { |i| i.to_file(f) }
        end
def to_file ( f ) size = 0 @indexes . each { size += Index :: FORMAT_SIZE } @idata . each do | i | size += IntData :: FORMAT_SIZE size += i . data_size end buf = [ @source , @name , @sym , @indexes . length ( ) , @idata . length ( ) , size ] . pack ( PFORMAT ) f . write ( buf ) @indexes . each { | i | i . to_file ( f ) } @idata . each { | i | i . to_file ( f ) } end
Pack contents to binary and write to file
Pack contents to binary and write to file
f