How to rewrite text in a console application?
public class WaveFormat { byte[] ByteSrcMas; BitArray BitSrcMas,BitDstMas; public int BpS; public int Size; public int Count; int Pas; public int Pass; public WaveFormat() { } public int ParseWaveFile(string file) { ByteSrcMas = File.ReadAllBytes(file); //считывание всего файла if ((ByteSrcMas[0] != 'R') || (ByteSrcMas[1] != 'I') || (ByteSrcMas[2] != 'F') || (ByteSrcMas[3] != 'F')) //проверка заголовка RIFF return 1; if ((ByteSrcMas[8] != 'W') || (ByteSrcMas[9] != 'A') || (ByteSrcMas[10] != 'V') || (ByteSrcMas[11] != 'E')) //проверка заголовка WAVE return 1; if ((ByteSrcMas[12] != 'f') || (ByteSrcMas[13] != 'm') || (ByteSrcMas[14] != 't') || (ByteSrcMas[15] != ' ')) //проверка заголовка fmt return 1; byte[] mas = new byte[4]; //считывание размера заголовков mas[0] = ByteSrcMas[16]; mas[1] = ByteSrcMas[17]; mas[2] = ByteSrcMas[18]; mas[3] = ByteSrcMas[19]; int value = BitConverter.ToInt32(mas, 0); byte[] mas2 = new byte[2]; mas2[0] = ByteSrcMas[20]; mas2[1] = ByteSrcMas[21]; int tag = BitConverter.ToInt16(mas2, 0); if (tag != 1) return 2; Count = 20 + 14; mas2[0] = ByteSrcMas[Count]; mas2[1] = ByteSrcMas[Count + 1]; BpS = BitConverter.ToInt16(mas2, 0); Count = Count + value - 16 + 2; if ((ByteSrcMas[Count] == 'f') && (ByteSrcMas[Count + 1] == 'a') && (ByteSrcMas[Count + 2] == 'c') && (ByteSrcMas[Count + 3] == 't')) { Count = Count + 3 + 1; //пропуск области fact mas[0] = ByteSrcMas[Count]; mas[1] = ByteSrcMas[Count + 1]; mas[2] = ByteSrcMas[Count + 2]; mas[3] = ByteSrcMas[Count + 3]; value = BitConverter.ToInt32(mas, 0); Count = Count + 3 + value + 1; } if ((ByteSrcMas[Count] != 'd') || (ByteSrcMas[Count + 1] != 'a') || (ByteSrcMas[Count + 2] != 't') || (ByteSrcMas[Count + 3] != 'a')) return 1; Count = Count + 3 + 1; mas[0] = ByteSrcMas[Count]; mas[1] = ByteSrcMas[Count + 1]; mas[2] = ByteSrcMas[Count + 2]; mas[3] = ByteSrcMas[Count + 3]; Size = BitConverter.ToInt32(mas, 0); //размер аудиоданных Count = Count + 3; BitSrcMas = new BitArray(ByteSrcMas); Pass = (Count * 8)+8; return 0; } }