Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. byte[] output = new byte[stream.Length];
  2. output = stream.ToArray();
  3. byte[] processingArray = new byte[16];
  4.  
  5. int index = 0;
  6. int chunks = output / 16;
  7. for(int i = 0; i < chunks; i++){
  8. for(int x = 0; x < 16; x++){
  9. processingArray[x] = output[x + index];
  10. }
  11. //do the processing on the array here
  12. index += 16;
  13. }
  14.  
  15. byte[] block = new byte[16];
  16. int bytesRead = stream.Read(block, 0, block.Length);
  17.  
  18. stream.Position = 0; // go to beginning of stream
  19.  
  20. byte[] buffer = new byte[16];
  21. while(stream.Read(buffer, 0, buffer.Length) > 0)
  22. {
  23. // process
  24. }
  25.  
  26. MemoryStream ms;
  27.  
  28. byte[] buffer = ms.GetBuffer();
  29. int offset = ms.Position;
  30. int left = ms.Length - offset;
  31.  
  32. while(left != 0)
  33. {
  34. // process buffer starting at offset.
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement