SHARE
TWEET

dmc5

a guest May 26th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. byte[] fileBytes = [THIS IS YOUR ORIGINAL FILE...]
  2.  
  3. List<byte> header = new List<byte>();
  4. int actualIndex = 0;
  5. int riffIndex = -1;
  6.  
  7. while (actualIndex < fileBytes.Length && riffIndex == -1)
  8. {
  9.     if(fileBytes[actualIndex] + fileBytes[actualIndex + 1] + fileBytes[actualIndex + 2] + fileBytes[actualIndex + 3] == "RIFF")
  10.     {
  11.         riffIndex = actualIndex;
  12.     }
  13.     else
  14.     {
  15.         actualIndex = actualIndex + 1;
  16.     }
  17. }
  18.  
  19. for(int x = 0; x < riffIndex; x++)
  20. {
  21.     header.Add(fileBytes[x]);
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top