Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to get the user defined method Pin
Eddy Vluggen21-Sep-15 5:22
professionalEddy Vluggen21-Sep-15 5:22 
GeneralRe: How to get the user defined method Pin
vijay kumar21-Sep-15 20:32
vijay kumar21-Sep-15 20:32 
QuestionWrite an algorithm to add and multiply two large integers, which cannot be represented by built-in types Pin
Nadeem Shaikh20-Sep-15 5:51
Nadeem Shaikh20-Sep-15 5:51 
AnswerRe: Write an algorithm to add and multiply two large integers, which cannot be represented by built-in types Pin
OriginalGriff20-Sep-15 6:04
mveOriginalGriff20-Sep-15 6:04 
QuestionProblem Solved: DataContract/WCF/GZip from .gz file to memory stream to object without creating a new file ? Pin
BillWoodruff20-Sep-15 0:31
professionalBillWoodruff20-Sep-15 0:31 
GeneralRe: DataContract/WCF/GZip from .gz file to memory stream to object without creating a new file ? Pin
Wendelius20-Sep-15 0:51
mentorWendelius20-Sep-15 0:51 
GeneralRe: DataContract/WCF/GZip from .gz file to memory stream to object without creating a new file ? Pin
BillWoodruff20-Sep-15 2:47
professionalBillWoodruff20-Sep-15 2:47 
AnswerRe: DataContract/WCF/GZip from .gz file to memory stream to object without creating a new file ? Pin
Wendelius20-Sep-15 7:16
mentorWendelius20-Sep-15 7:16 
Not sure if this helps with your problem but when thinking about your question, why use the memorystream at all.

Consider the following:
C#
public class SomeClass {

      [DataMember()]
      public string FirstName;

      [DataMember]
      public string LastName;

      public static bool ObjectToGZ(SomeClass instance, string gzFilePath) {
         using (GZipStream zipstream 
         = new GZipStream(File.Open(gzFilePath, FileMode.Create), CompressionMode.Compress, false)) {
            DataContractSerializer ser = new DataContractSerializer(typeof(SomeClass));
            ser.WriteObject(zipstream, instance);
            zipstream.Close();
         }
         return true;
      }

      public static SomeClass GZToObject(string gzFilePath) {
         DataContractSerializer serializer = new DataContractSerializer(typeof(SomeClass));
         SomeClass someClassInstance = null;

         using (GZipStream deCompStream 
         = new GZipStream(File.Open(gzFilePath, FileMode.Open), CompressionMode.Decompress, false)) {
            someClassInstance = (SomeClass)serializer.ReadObject(deCompStream);
         }

         return someClassInstance;
      }
   }
And the call
C#
SomeClass some1 = new SomeClass() { FirstName = "A", LastName = "B" };
SomeClass.ObjectToGZ(some1, "C:\\TEMP\\BillTest1.gz");
SomeClass some2 = SomeClass.GZToObject("C:\\TEMP\\BillTest1.gz");

AnswerRe: Problem Solved: DataContract/WCF/GZip from .gz file to memory stream to object without creating a new file ? Pin
Richard Deeming21-Sep-15 2:06
mveRichard Deeming21-Sep-15 2:06 
Questionhow to change font size in a richtextbox without selecting the text Pin
Member 1100213719-Sep-15 8:54
Member 1100213719-Sep-15 8:54 
QuestionRe: how to change font size in a richtextbox without selecting the text Pin
Eddy Vluggen19-Sep-15 9:10
professionalEddy Vluggen19-Sep-15 9:10 
AnswerRe: how to change font size in a richtextbox without selecting the text Pin
Member 1100213719-Sep-15 9:15
Member 1100213719-Sep-15 9:15 
GeneralRe: how to change font size in a richtextbox without selecting the text Pin
Eddy Vluggen19-Sep-15 9:20
professionalEddy Vluggen19-Sep-15 9:20 
AnswerRe: how to change font size in a richtextbox without selecting the text Pin
BillWoodruff19-Sep-15 13:48
professionalBillWoodruff19-Sep-15 13:48 
QuestionRE-GET and SET PROPERTY Pin
Member 1116162518-Sep-15 19:32
Member 1116162518-Sep-15 19:32 
AnswerRe: RE-GET and SET PROPERTY Pin
Wendelius18-Sep-15 19:41
mentorWendelius18-Sep-15 19:41 
AnswerRe: RE-GET and SET PROPERTY Pin
Eddy Vluggen18-Sep-15 21:03
professionalEddy Vluggen18-Sep-15 21:03 
AnswerRe: RE-GET and SET PROPERTY Pin
OriginalGriff18-Sep-15 21:34
mveOriginalGriff18-Sep-15 21:34 
AnswerRe: RE-GET and SET PROPERTY Pin
Gilbert Consellado19-Sep-15 6:17
professionalGilbert Consellado19-Sep-15 6:17 
Question[SOLVED]: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 1:18
Bastar Media18-Sep-15 1:18 
AnswerRe: Not Getting Proper Output From Compiled EXE File Pin
Pete O'Hanlon18-Sep-15 1:42
mvePete O'Hanlon18-Sep-15 1:42 
AnswerRe: Not Getting Proper Output From Compiled EXE File Pin
GuyThiebaut18-Sep-15 1:52
professionalGuyThiebaut18-Sep-15 1:52 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 1:59
Bastar Media18-Sep-15 1:59 
AnswerCODE: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 2:10
Bastar Media18-Sep-15 2:10 
GeneralRe: CODE: Not Getting Proper Output From Compiled EXE File Pin
Richard MacCutchan18-Sep-15 2:25
mveRichard MacCutchan18-Sep-15 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.