Class: AudioTag::ID3::StreamSection

Inherits:
StreamReader show all
Defined in:
lib/audio_tag/id3/stream_section.rb

Overview

The overridden extract! method may not need to read all data within the stream section (for example if it contains embedded binary data). Therefore the initializer will also ensure that the stream is advanced to the end of the current section after extraction to prevent serial sections from overlapping.

Direct Known Subclasses

Header, V2::Frame, V2::Tag

Instance Attribute Summary

Attributes inherited from StreamReader

#stream

Instance Method Summary collapse

Methods inherited from StreamReader

#read, #read!, #read_byte, #read_byte!, #read_bytes, #read_bytes!, #read_bytes_until, #read_bytes_until!, #read_until, #read_until!

Constructor Details

#initialize(stream) ⇒ StreamSection

Returns a new instance of StreamSection.



23
24
25
26
27
28
29
# File 'lib/audio_tag/id3/stream_section.rb', line 23

def initialize(stream)
  super

  @first_pos = stream.pos

  extract! && advance!
end