示例#1
0
        /**
         * <summary>Append tags to the end of the file.</summary>
         * <param name="tag">The tag to be appended.</param>
         */
        public void Append(ITag tag)
        {
            BigBinaryWriter bw = new BigBinaryWriter(memStream);

            bw.Seek(0, SeekOrigin.End);
            tag.WriteData(bw);
            bw.Flush();
        }
示例#2
0
        /**
         * <summary>Append a list of tags to the end of the file.</summary>
         * <param name="tags">The list of tags.</param>
         */
        public void AppendAll(List <ITag> tags)
        {
            BigBinaryWriter bw = new BigBinaryWriter(memStream);

            bw.Seek(0, SeekOrigin.End);
            foreach (ITag tag in tags)
            {
                tag.WriteData(bw);
            }
            bw.Flush();
        }
示例#3
0
        /**
         * <summary>Save tags to the file. This method will create a new file if one does not exist.
         * This will overwrite the existing file. To append tags
         * see #Append(ITag) and #AppendAll(List)</summary>
         * <param name="tags">The list of tags to save.</param>
         */
        public void Save(List <ITag> tags)
        {
            memStream.SetLength(0);
            memStream.Position = 0;
            BigBinaryWriter bw = new BigBinaryWriter(memStream);

            foreach (ITag tag in tags)
            {
                tag.WriteData(bw);
            }
            bw.Flush();
        }