def write_extended_header
      unless @obj.extended_header.empty?
        @stream.write @stream.encode([1,0,0,0], "BY")
        @obj.extended_header.each do |extension|
        @stream.write @stream.encode extension[:esize], "UL"
        @stream.write @stream.encode extension[:ecode], "UL"
        @stream.write @stream.encode_string_to_length(@stream.encode(extension[:data], "STR"), extension[:esize] - 8)
        end
      else
        @stream.write @stream.encode([0,0,0,0], "BY")
      end
    end
def write_extended_header
      unless @obj.extended_header.empty?
        @stream.write @stream.encode([1,0,0,0], "BY")
        @obj.extended_header.each do |extension|
        @stream.write @stream.encode extension[:esize], "UL"
        @stream.write @stream.encode extension[:ecode], "UL"
        @stream.write @stream.encode_string_to_length(@stream.encode(extension[:data], "STR"), extension[:esize] - 8)
        end
      else
        @stream.write @stream.encode([0,0,0,0], "BY")
      end
    end
Write Extended Header