4 Replies - 1453 Views - Last Post: 19 November 2009 - 03:06 PM Rate Topic: -----

#1 medurikalyan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-November 09

Read a specific file from bunch of files in MemoryStream

Posted 19 November 2009 - 02:34 PM

Hi All,

I have a situation, where i should read a specific file from a bunch files from memorystream. I have a memorystream, which contains 4 files data. Now i want to read a specific file from the memorystream based on the file name. Bare with me if this is a small question because i have never used memorystream before. Waiting for the reply.

Thanks,
Chowdary.
Is This A Good Question/Topic? 0
  • +

Replies To: Read a specific file from bunch of files in MemoryStream

#2 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Read a specific file from bunch of files in MemoryStream

Posted 19 November 2009 - 02:41 PM

MemoryStream doesn't have a name like a file, it's just a block of bytes in memory that you can treat like a stream. Unless you know the starting/ending of the files, you won't know where they start or end.

Why would you put the data from four files into one MemoryStream?
Was This Post Helpful? 0
  • +
  • -

#3 medurikalyan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-November 09

Re: Read a specific file from bunch of files in MemoryStream

Posted 19 November 2009 - 02:47 PM

Hi Momerath,
Here I have a zip file which i need to extract and put into a memory stream. I have four files in that zip file. So i have to extract them to my memory stream. I may have more that four files in the zip file, I can't create a memory stream for each file. But the thing is i will be having only one xml file in the whole bunch of files.

Here i need to read that xml from that memory stream. SO this is the scenario, please guide me because i am new to this memory stream.

Thanks,
Chowdary.

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Read a specific file from bunch of files in MemoryStream

Posted 19 November 2009 - 03:00 PM

You will want to read the information at the following link then, it is a sample program on how to do what you are asking :)

http://msdn.microsof...y/ywf6dxhx.aspx
Was This Post Helpful? 0
  • +
  • -

#5 medurikalyan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-November 09

Re: Read a specific file from bunch of files in MemoryStream

Posted 19 November 2009 - 03:06 PM

I have already extracted the zipped file to memorystream by using a #ZipLib(third party dll). Now what i need to do is, i need to read the data back from that memorystream.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1