def transfer_syntax=(new_syntax)
      # Verify old and new transfer syntax:
      new_uid = LIBRARY.uid(new_syntax)
      old_uid = LIBRARY.uid(transfer_syntax)
      raise ArgumentError, "Invalid/unknown transfer syntax specified: #{new_syntax}" unless new_uid && new_uid.transfer_syntax?
      raise ArgumentError, "Invalid/unknown existing transfer syntax: #{new_syntax} Unable to reliably handle byte order encoding. Modify the transfer syntax element directly instead." unless old_uid && old_uid.transfer_syntax?
      # Set the new transfer syntax:
      if exists?("0002,0010")
        self["0002,0010"].value = new_syntax
      else
        add(Element.new("0002,0010", new_syntax))
      end
      # Update our Stream instance with the new encoding:
      @stream.endian = new_uid.big_endian?
      # If endianness is changed, re-encode elements (only elements depending on endianness will actually be re-encoded):
      encode_children(old_uid.big_endian?) if old_uid.big_endian? != new_uid.big_endian?
    end
def transfer_syntax=(new_syntax)
      # Verify old and new transfer syntax:
      new_uid = LIBRARY.uid(new_syntax)
      old_uid = LIBRARY.uid(transfer_syntax)
      raise ArgumentError, "Invalid/unknown transfer syntax specified: #{new_syntax}" unless new_uid && new_uid.transfer_syntax?
      raise ArgumentError, "Invalid/unknown existing transfer syntax: #{new_syntax} Unable to reliably handle byte order encoding. Modify the transfer syntax element directly instead." unless old_uid && old_uid.transfer_syntax?
      # Set the new transfer syntax:
      if exists?("0002,0010")
        self["0002,0010"].value = new_syntax
      else
        add(Element.new("0002,0010", new_syntax))
      end
      # Update our Stream instance with the new encoding:
      @stream.endian = new_uid.big_endian?
      # If endianness is changed, re-encode elements (only elements depending on endianness will actually be re-encoded):
      encode_children(old_uid.big_endian?) if old_uid.big_endian? != new_uid.big_endian?
    end
Changes the transfer syntax Element of the DObject instance, and performs re-encoding of all
 numerical values if a switch of endianness is implied.

 @note This method does not change the compressed state of the pixel data element. Changing
 the transfer syntax between an uncompressed and compressed state will NOT change the pixel
 data accordingly (this must be taken care of manually).

 @param [String] new_syntax the new transfer syntax string to be applied to the DObject