Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Removing data in a stream?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PBR - 26 Aug 2004 00:34 GMT
Hi,

What's the most efficient way to remove data within a stream? For example,
say I have a MemoryStream, and I use a StreamWriter to write "Every dog has
it's day" into the memory stream. Now, I want to correct the grammar and
remove the apostrophe from "it's". I could read the text out and manipulate
the data as a string and then write the whole thing back in place of the
original bytes, but is there a way to basically "remove" bytes from the
stream and resize it appropriately, without reading the whole thing out to a
string first?

Thanks
Sijin Joseph - 27 Aug 2004 10:21 GMT
If the stream supports seeking (determined by the CanSeek prop) then you
can use the Seek() method to have random access to the stream rather
than sequential access.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Hi,
>
[quoted text clipped - 8 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.