Method: ID3.mungeSize

Defined in:
lib/id3/module_methods.rb

.mungeSize(size) ⇒ Object


convert the size into 4 bytes to be written into an id3v2 header



114
115
116
117
118
119
120
121
122
123
# File 'lib/id3/module_methods.rb', line 114

def ID3.mungeSize(size)
  bytes = Array.new(4,0)
  j = 0;  i = 3
  while i >= 0
    bytes[j],size = size.divmod(128**i)
    j += 1
    i -= 1
  end
  return bytes
end