Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:14
ediazc6-Oct-05 5:14 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Guffa6-Oct-05 6:12
Guffa6-Oct-05 6:12 
AnswerRe: Why BinaryReader don't have the EOF property Pin
S. Senthil Kumar5-Oct-05 19:42
S. Senthil Kumar5-Oct-05 19:42 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Guffa5-Oct-05 19:50
Guffa5-Oct-05 19:50 
GeneralRe: Why BinaryReader don't have the EOF property Pin
S. Senthil Kumar5-Oct-05 20:38
S. Senthil Kumar5-Oct-05 20:38 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:04
ediazc6-Oct-05 5:04 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:01
ediazc6-Oct-05 5:01 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Moshe B16-Apr-10 5:18
Moshe B16-Apr-10 5:18 
well.. why don't you just check if the stream position property equals to the length?
that should solve the problem.
void Open()
{
FileStream stream = File.Open(@"C:\myfile.txt", FileMode.Open);
	byte b;
	// ReadByte returns -1 at EOF.
	while (stream.Position < stream.Length) 
	{
        	(b = (byte)stream.ReadByte()) != 255
        	Console.WriteLine(b.ToString());
	}
}


It will also work if you are using a BinaryReader.
QuestionWebClient and HTTPWebRequest dealing with redireciton? Pin
Red_Wizard_Shot_The_Food5-Oct-05 15:00
Red_Wizard_Shot_The_Food5-Oct-05 15:00 
AnswerRe: WebClient and HTTPWebRequest dealing with redireciton? Pin
Red_Wizard_Shot_The_Food5-Oct-05 16:05
Red_Wizard_Shot_The_Food5-Oct-05 16:05 
Questionnewbee ques on structs Pin
ter815-Oct-05 14:12
susster815-Oct-05 14:12 
AnswerRe: newbee ques on structs Pin
enjoycrack5-Oct-05 14:19
enjoycrack5-Oct-05 14:19 
GeneralRe: newbee ques on structs Pin
ter815-Oct-05 14:24
susster815-Oct-05 14:24 
GeneralRe: newbee ques on structs Pin
enjoycrack6-Oct-05 10:31
enjoycrack6-Oct-05 10:31 
AnswerRe: newbee ques on structs Pin
Christian Graus5-Oct-05 14:57
protectorChristian Graus5-Oct-05 14:57 
QuestionCurrency Symbol Pin
Dominic Farr5-Oct-05 13:00
Dominic Farr5-Oct-05 13:00 
QuestionGetting my program to look up UK addresses from postcodes... How? Pin
Red_Wizard_Shot_The_Food5-Oct-05 12:15
Red_Wizard_Shot_The_Food5-Oct-05 12:15 
QuestionPainting in a Panel Pin
Red Tricycle5-Oct-05 11:18
Red Tricycle5-Oct-05 11:18 
AnswerRe: Painting in a Panel Pin
Heath Stewart5-Oct-05 11:46
protectorHeath Stewart5-Oct-05 11:46 
GeneralRe: Painting in a Panel Pin
Red Tricycle5-Oct-05 20:02
Red Tricycle5-Oct-05 20:02 
QuestionCreate custom Calendar Pin
Gywox5-Oct-05 11:09
Gywox5-Oct-05 11:09 
QuestionFile name validation Pin
baronics5-Oct-05 10:29
baronics5-Oct-05 10:29 
AnswerRe: File name validation Pin
David Stone5-Oct-05 11:06
sitebuilderDavid Stone5-Oct-05 11:06 
QuestionHow to get datarow from OdbcDataReader? Pin
Ming Luo5-Oct-05 9:56
Ming Luo5-Oct-05 9:56 
AnswerRe: How to get datarow from OdbcDataReader? Pin
Wjousts5-Oct-05 10:10
Wjousts5-Oct-05 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.