From: Allan Bredahl on
Hi all

I have constructed a custom message encoder for WCF, which works just great.

But, now I'm trying to build in encryption which is quite straight forward.

The problem is that my encoder works with ArraySegments of bytes.

The original segment is a 1024 byte segment with offset 0 and Count = 748

Then I encrypt this resulting in a 1024 byte segment with offset 0 and count
=1024

This is send to the server and decrypted to an ArraySegment 100% identical
with the original, the only problem is that I now have lost the original
count of 748.

I have a 1024 byte array with a lot of zero values, but how do I determine
where the "real" data ends (747)

I could remove all zero values from the end, but what if the original array
had as 0 as the last value ?


Any sugestions?

Thanks in advance

Allan