예제 #1
0
 private static bool CheckForValidXingHeader(Mp3Frame frame, int offset)
 {
     byte[] data = null;
     if (frame.ReadData(ref data, 0) < 4)
     {
         return(false);
     }
     if ((data[offset + 0] == 'X' && data[offset + 1] == 'i' && data[offset + 2] == 'n' && data[offset + 3] == 'g') ||
         (data[offset + 0] == 'I' && data[offset + 1] == 'n' && data[offset + 3] == 'f' && data[offset + 3] == 'o'))
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
        private static int ReadHeaderFlags(Mp3Frame frame, int offset)
        {
            byte[] data = null;
            if (frame.ReadData(ref data, 0) < 4)
            {
                throw new System.IO.EndOfStreamException();
            }
            int i = 0;

            for (int j = 0; j <= 3; j++)
            {
                i   = data[offset + j];
                i <<= 8;
            }

            return(i);
        }