c# - Access content-length in custom WCF MessageEncoder -


i attempting show progress of streamed wcf message implementing custom messageencoder , overriding readmessage method. can download data , report progress coming in interested know full message size before happens.

is possible in encoder or somewhere else see size of incoming message before downloaded? know length available in http headers don't see way access them.

here have far:

public override message readmessage(stream stream, int maxsizeofheaders, string contenttype) {     memorystream content = new memorystream();     byte[] buffer = new byte[512];     var bytesread = 0;          {         bytesread = stream.read(buffer, 0, buffer.length);         content.write(buffer, 0, bytesread);          // report progress         this.reportprogress("downloading...", bytesread);     } while (bytesread > 0); 


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -