class WahWah::Asf::Object
The base unit of organization for ASF files is called the ASF object. It consists of a 128-bit GUID for the object, a 64-bit integer object size, and the variable-length object data. The value of the object size field is the sum of 24 bytes plus the size of the object data in bytes. The following diagram illustrates the ASF object structure:
16 bytes: Object
GUID 8 bytes: Object
size variable-sized: Object
data
Constants
- HEADER_FORMAT
- HEADER_SIZE
Attributes
guid[R]
Public Class Methods
new()
click to toggle source
# File lib/wahwah/asf/object.rb, line 21 def initialize guid_bytes, @size = @file_io.read(HEADER_SIZE)&.unpack(HEADER_FORMAT) return unless valid? @size = @size - HEADER_SIZE @guid = Helper.byte_string_to_guid(guid_bytes) end
Public Instance Methods
valid?()
click to toggle source
# File lib/wahwah/asf/object.rb, line 29 def valid? !@size.nil? && @size >= HEADER_SIZE end