Hi all,
I was trying to unzip a file into the memory stream instead of writing it to text file. The problem I am facing is, the 13 characters in the file's first line are missing other than that everything is fine.
Please suggest any ideas!!!!!
I have tried setting the SeekOrigin to Begin and also set the Position to 0 but of no use.
The code is pasted below,
[CODE=cpp]FileStream fs = File.OpenRead(_ fileName);
using (ZipInputStream s = new ZipInputStream( fs))
{
ZipEntry theEntry;
while ((theEntry = s.GetNextEntry( )) != null)
{
int size = 2048;
byte[] data = new byte[2048];
MemoryStream ms = new MemoryStream(da ta);
StreamWriter streamWriter = new StreamWriter(ms );
size = s.Read(data, 0, data.Length);
if (size > 0)
{
streamWriter.Wr ite(data);
ms.Position = 0;
}
else
{
break;
}
}
}[/CODE]
I was trying to unzip a file into the memory stream instead of writing it to text file. The problem I am facing is, the 13 characters in the file's first line are missing other than that everything is fine.
Please suggest any ideas!!!!!
I have tried setting the SeekOrigin to Begin and also set the Position to 0 but of no use.
The code is pasted below,
[CODE=cpp]FileStream fs = File.OpenRead(_ fileName);
using (ZipInputStream s = new ZipInputStream( fs))
{
ZipEntry theEntry;
while ((theEntry = s.GetNextEntry( )) != null)
{
int size = 2048;
byte[] data = new byte[2048];
MemoryStream ms = new MemoryStream(da ta);
StreamWriter streamWriter = new StreamWriter(ms );
size = s.Read(data, 0, data.Length);
if (size > 0)
{
streamWriter.Wr ite(data);
ms.Position = 0;
}
else
{
break;
}
}
}[/CODE]
Comment