Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. byte[] buff = null;
  15. FileStream fs = new FileStream("D:\\r.mp3.out.gz",
  16. FileMode.Open,
  17. FileAccess.Read);
  18. BinaryReader br = new BinaryReader(fs);
  19. long numBytes = new FileInfo("D:\\r.mp3.out.gz").Length;
  20. buff = br.ReadBytes(10);
  21.  
  22. byte flags = buff[3];
  23.  
  24. byte MASK_ASCII = 0xFF;
  25. byte MASK_FTEXT = 0x01;
  26. byte MASK_FHCRC = 0x02;
  27. byte MASK_FEXTRA = 0x04;
  28. byte MASK_FNAME = 0x08;
  29. byte MASK_FCOMMENT = 0x10;
  30.  
  31. if ((flags & MASK_FNAME) != 0)
  32. {
  33. //blah
  34. while (br.ReadChar() != 0)
  35. {
  36.  
  37. }
  38. }
  39.  
  40. if ((flags & MASK_FCOMMENT) != 0)
  41. {
  42. char c;
  43. while ((c = br.ReadChar()) != 0)
  44. {
  45. System.Console.Write(c);
  46. }
  47.  
  48. System.Console.WriteLine();
  49. }
  50.  
  51. System.Console.WriteLine(buff[3]);
  52. System.Console.ReadLine();
  53. return;
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement