コード例 #1
0
 public static int GetTagSize(string path)
 {
     using (FileStream stream1 = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))
     {
         return(ID3v2Helper.GetTagSize(stream1));
     }
 }
コード例 #2
0
        public static bool RemoveTag(string path)
        {
            int num1 = ID3v2Helper.GetTagSize(path);

            if (num1 > 0)
            {
                Utils.ReplaceBytes(path, num1, new byte[0]);
                return(true);
            }
            return(false);
        }
コード例 #3
0
        public void Save(string path)
        {
            int num1 = ID3v2Helper.GetTagSize(path);

            byte[] buffer1 = this.GetBytes(num1);
            if (buffer1.Length < num1)
            {
                throw new ApplicationException("GetBytes() returned a size less than the minimum size");
            }
            if (buffer1.Length > num1)
            {
                Utils.ReplaceBytes(path, num1, buffer1);
            }
            else
            {
                using (FileStream stream1 = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.None))
                {
                    stream1.Write(buffer1, 0, buffer1.Length);
                }
            }
        }
コード例 #4
0
 public static bool DoesTagExist(string path)
 {
     return(ID3v2Helper.GetTagSize(path) != 0);
 }
コード例 #5
0
 public static bool DoesTagExist(Stream stream)
 {
     return(ID3v2Helper.GetTagSize(stream) != 0);
 }