text: public override void WriteBytes(byte[] b, int offset, int length){Debug.Assert(b.Length >= offset + length);if (length == 0){return;}if (outerInstance.upto == outerInstance.blockSize){if (outerInstance.currentBlock != null){outerInstance.blocks.Add(outerInstance.currentBlock);outerInstance.blockEnd.Add(outerInstance.upto);}outerInstance.currentBlock = new byte[outerInstance.blockSize];outerInstance.upto = 0;}int offsetEnd = offset + length;while (true){int left = offsetEnd - offset;int blockLeft = outerInstance.blockSize - outerInstance.upto;if (blockLeft < left){System.Buffer.BlockCopy(b, offset, outerInstance.currentBlock, outerInstance.upto, blockLeft);outerInstance.blocks.Add(outerInstance.currentBlock);outerInstance.blockEnd.Add(outerInstance.blockSize);outerInstance.currentBlock = new byte[outerInstance.blockSize];outerInstance.upto = 0;offset += blockLeft;}else{System.Buffer.BlockCopy(b, offset, outerInstance.currentBlock, outerInstance.upto, left);outerInstance.upto += left;break;}}}