예제 #1
0
        /// <summary>
        ///    Writes the tags contained in the current instance to the
        ///    beginning of the file that created it, overwriting the
        ///    existing tags.
        /// </summary>
        /// <returns>
        ///    A <see cref="long" /> value indicating the seek position
        ///    in the file at which the written tags end. This also
        ///    marks the seek position at which the media begins.
        /// </returns>
        public long Write()
        {
            ByteVector data = Render();

            file.Insert(data, 0, TotalSize);
            return(data.Count);
        }
예제 #2
0
        /// <summary>
        ///    Writes the tags contained in the current instance to the
        ///    end of the file that created it, overwriting the existing
        ///    tags.
        /// </summary>
        /// <returns>
        ///    A <see cref="long" /> value indicating the seek position
        ///    in the file at which the written tags begin. This also
        ///    marks the seek position at which the media ends.
        /// </returns>
        public long Write()
        {
            long       total_size = TotalSize;
            ByteVector data       = Render();

            file.Insert(data, file.Length - total_size, total_size);
            return(file.Length - data.Count);
        }
예제 #3
0
        public long Overwrite(TagLib.File file, long sizeChange)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }
            if (!from_disk)
            {
                throw new InvalidOperationException("Cannot overwrite headers not on disk.");
            }
            long old_header_size = HeaderSize;

            DataSize += sizeChange;
            file.Insert(Render(), position, old_header_size);
            return(sizeChange + HeaderSize - old_header_size);
        }