EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Does streams have to support Length? MessageBodyStream does not work.

#31051
Posted: 10/20/2014 07:08:56
by Martin Bring (Basic support level)
Joined: 10/20/2014
Posts: 2

Hi.

I am evaluating your product and just now noticed that Zip and OpenPGP does not support MessageBodyStream (which i often used to return a Stream from a .Net WCF service). One get "Method not supported" when calling TElZipWriter.Add() and TElPGPWriter.Encrypt().

Is it so that your code uses stream.Length? I think that if the stream does not support seeking it does not support Length either, wich is the case regarding MessageBodyStream. Checking CanSeek=true will help to show an error message, but if you are dependent of Length it will not help my issue though.

Is there a possibility to use MessageBodyStream anyway or do I have to convert it to another type of Stream?

Regards Martin

if(stream.CanSeek)
int length = stream.Length
#31052
Posted: 10/20/2014 07:18:17
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Quote
Is it so that your code uses stream.Length?

It uses both Length and Seek, so input stream must support both operations.
#31118
Posted: 10/27/2014 07:59:29
by Martin Bring (Basic support level)
Joined: 10/20/2014
Posts: 2

Thanks you for quick reply.

I solved it by copying the MessageBodyStream to a MemoryStream.

Regards
Martin Bring

Reply

Statistics

Topic viewed 968 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!