473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Copy Stream

Hi All, I have a class in which one member is Stream. I initialize this
member with a local value of a stream.
Foo o=new Foo();
o.Stream=localStream;
doesn't seems to work. Will I have to do a DEEP Copy? Incase how should I
proceed?

Thanks
Jun 9 '06 #1
1 6570
Hi,

"Vai2000" <no****@microsoft.com> wrote in message
news:uN****************@TK2MSFTNGP05.phx.gbl...
Hi All, I have a class in which one member is Stream. I initialize this
member with a local value of a stream.
Foo o=new Foo();
o.Stream=localStream;


This should work, what error are you getting?
Remember that now you have tow instances that reference the SAME instance of
stream, so if you call localStream.Close() o.Stream will be closed too
( they reference the same instance)
otherwise, what error are you getting?


Jun 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Thomas J. Clancy | last post by:
I was wondering if anyone knew of a way to use std::copy() and istream_iterator<>/ostream_iterator<> write a file copy function that is quick and efficient. Doing this messes up the file because...
42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
7
by: Philipp | last post by:
Hello, How can you copy a stream (or change a reference to it)? Imagine a function which writes "Hello" to a filestream: void SomeClass::write(ofstream& originalStream){ ofstream newStream;...
4
by: martin | last post by:
Hi, I am copying an xml file like so. Dim xmlDoc As New XmlDocument xmlDoc.Load("C:\Program Files\Templates\message.msg") Console.WriteLine("Tmaplate loaded") xmlDoc.Save("C:\Program...
8
by: luis molina Micasoft | last post by:
it seems that when i do file.copy the svchost.exe is hanged, i mean if i make 40 threads of file.copy , 40 copys of files at same time the system is going down and stop responding, this is when i'm...
0
by: NetronProject | last post by:
My copy/paste operation results in a MemoryStream full of '\0' characters on the Clipboard. Maybe my approach to copy/paste is wrong when handling generic types. All entries in the CollectionBase...
22
by: Steven Blair | last post by:
I need to perform a Deep Copy on an ArrayList. I wrote a small sample app to prove this could be done: ArrayList a = new ArrayList(); ArrayList b = new ArrayList(); a.Add("Hello"); b =...
0
by: Al Reynolds | last post by:
Morning, I'm trying to copy a stream from mobical.net to a local file (for those of you who don't know, Mobical is a free online SyncML server, but they don't officially offer iCalendar...
4
by: Herman.Schultz | last post by:
Hi, How can I use iostream library in c++ to copy a file from i th byte to an output file? Thank you.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.