A
Arthur Yousif
Sorry, my previous post was posted by accident before I finished it.
Hello,
I have a stream I'm reading from, which is from an HttpWebRequest and the
Length property is not available because the stream doesn't support seek
operations.
I'm looping through the stream byte by byte but that's taking a long time on
really big files. It would be nice to do something like I do in my C++
applications where I read the data in chunks and then reallocation more
memory to my destination block.
Is there a way to do something similar in ASP.NET using C#? Something like:
Byte[] destBuf = new Byte[1024];
int iCharsRead = strResponse.Read(destBuf, 0, 1024);
int idx = 0;
while (iCharsRead != 0)
{
idx += iCharsRead;
lTotalBytesRead += iCharsRead;
if (iCharsRead < iChunk)
break;
// here I would allocate more memory space to destBuf and then
// read the response stream's data into the destBuf at the idx location
// but I can't find a way to do it in c#. Any ideas?
iCharsRead = strResponse.Read(destBuf, idx, 1024);
}
Hello,
I have a stream I'm reading from, which is from an HttpWebRequest and the
Length property is not available because the stream doesn't support seek
operations.
I'm looping through the stream byte by byte but that's taking a long time on
really big files. It would be nice to do something like I do in my C++
applications where I read the data in chunks and then reallocation more
memory to my destination block.
Is there a way to do something similar in ASP.NET using C#? Something like:
Byte[] destBuf = new Byte[1024];
int iCharsRead = strResponse.Read(destBuf, 0, 1024);
int idx = 0;
while (iCharsRead != 0)
{
idx += iCharsRead;
lTotalBytesRead += iCharsRead;
if (iCharsRead < iChunk)
break;
// here I would allocate more memory space to destBuf and then
// read the response stream's data into the destBuf at the idx location
// but I can't find a way to do it in c#. Any ideas?
iCharsRead = strResponse.Read(destBuf, idx, 1024);
}