Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] output = new byte[stream.Length];
- output = stream.ToArray();
- byte[] processingArray = new byte[16];
- int index = 0;
- int chunks = output / 16;
- for(int i = 0; i < chunks; i++){
- for(int x = 0; x < 16; x++){
- processingArray[x] = output[x + index];
- }
- //do the processing on the array here
- index += 16;
- }
- byte[] block = new byte[16];
- int bytesRead = stream.Read(block, 0, block.Length);
- stream.Position = 0; // go to beginning of stream
- byte[] buffer = new byte[16];
- while(stream.Read(buffer, 0, buffer.Length) > 0)
- {
- // process
- }
- MemoryStream ms;
- byte[] buffer = ms.GetBuffer();
- int offset = ms.Position;
- int left = ms.Length - offset;
- while(left != 0)
- {
- // process buffer starting at offset.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement