Read it in as byte array or whatever first, then convert that to the appropriate string type i.e. for unicode use:
Code:
System.Text.Encoding encoding = System.Text.UnicodeEncoding();
string result = encoding.GetString(bytes, 0, i);
When reading in large chunks of text where you are unsure of the size, keep in mind that if you read in too much at a time (a large default buffer size) there is a chance you end up in unallocated memory, which will result in no data being read at all. Read in smaller chunks of memory at a time for these situations.