Hi all, I am attempting to stream a text file which also contains binary data. This in it’s self is not a problem. The problem is, I cannot keep track of where I am in the file. Hence I am not getting all the binary data.
So I suppose my problem is that I cannot find my position in the file where the binary data finishes . . .
The code I am using at the moment in brief.
When I get to the end of the file my filePositionPointer is only a third of the size of fileLen? Grrrr! deep breaths!! lol
Hope this makes sense
Any help appreciated.
Age is a consequence of experience
So I suppose my problem is that I cannot find my position in the file where the binary data finishes . . .
The code I am using at the moment in brief.
Code:
long fileLen = streamReader.BaseStream.Length;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = streamReader.ReadLine()) != null)
{
if (!gettingBinaryImage)
filePositionPointer += line.Length + newline.Length;
else
filePositionPointer += line.Length;
}
When I get to the end of the file my filePositionPointer is only a third of the size of fileLen? Grrrr! deep breaths!! lol
Hope this makes sense
Any help appreciated.
Age is a consequence of experience