PC Review


Reply
Thread Tools Rate Thread

ArraySegment

 
 
Allan Bredahl
Guest
Posts: n/a
 
      27th Jan 2010
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




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 AM.