Click here to Skip to main content
15,882,388 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Irked! Irked I am. Pin
BernardIE531717-Aug-23 15:41
BernardIE531717-Aug-23 15:41 
GeneralRe: Irked! Irked I am. Pin
PIEBALDconsult17-Aug-23 15:40
mvePIEBALDconsult17-Aug-23 15:40 
GeneralRe: Irked! Irked I am. Pin
Graeme_Grant17-Aug-23 16:18
mvaGraeme_Grant17-Aug-23 16:18 
GeneralRe: Irked! Irked I am. Pin
PIEBALDconsult17-Aug-23 16:31
mvePIEBALDconsult17-Aug-23 16:31 
GeneralRe: Irked! Irked I am. Pin
Graeme_Grant17-Aug-23 16:49
mvaGraeme_Grant17-Aug-23 16:49 
GeneralRe: Irked! Irked I am. Pin
Daniel Pfeffer17-Aug-23 17:41
professionalDaniel Pfeffer17-Aug-23 17:41 
GeneralRe: Irked! Irked I am. Pin
Richard Deeming17-Aug-23 21:33
mveRichard Deeming17-Aug-23 21:33 
GeneralRe: Irked! Irked I am. Pin
Jörgen Andersson17-Aug-23 21:40
professionalJörgen Andersson17-Aug-23 21:40 
PIEBALDconsult wrote:
I would much rather have FileStream.ReadByte() throw an Exception when it hits EOF.

No, because exception handling is so much more costly than a simple check.
Also keep in mind that ReadByte internally does a check for Length == Position and returns -1 if they're equal. Reference Source[^]
So if you want to half the number of comparisons you should simply check for Length == Position before calling ReadByte.
<edit>Doh, doesn't half anything except when you have reached the eof.</edit>

But the question is rather, why don't you use Read() with a buffer instead? Uses one check for every Read().
Wrong is evil and must be defeated. - Jeff Ello

GeneralRe: Irked! Irked I am. Pin
PIEBALDconsult18-Aug-23 4:13
mvePIEBALDconsult18-Aug-23 4:13 
GeneralRe: Irked! Irked I am. Pin
Jörgen Andersson18-Aug-23 4:35
professionalJörgen Andersson18-Aug-23 4:35 
GeneralRe: Irked! Irked I am. Pin
PIEBALDconsult18-Aug-23 5:52
mvePIEBALDconsult18-Aug-23 5:52 
GeneralRe: Irked! Irked I am. Pin
jschell18-Aug-23 12:15
jschell18-Aug-23 12:15 
GeneralRe: Irked! Irked I am. Pin
PIEBALDconsult18-Aug-23 12:51
mvePIEBALDconsult18-Aug-23 12:51 
GeneralFound a new way to get rid of scammers. Pin
OriginalGriff17-Aug-23 8:47
mveOriginalGriff17-Aug-23 8:47 
GeneralRe: Found a new way to get rid of scammers. Pin
Slacker00717-Aug-23 8:58
professionalSlacker00717-Aug-23 8:58 
GeneralRe: Found a new way to get rid of scammers. Pin
raddevus17-Aug-23 9:52
mvaraddevus17-Aug-23 9:52 
GeneralRe: Found a new way to get rid of scammers. Pin
pkfox17-Aug-23 22:14
professionalpkfox17-Aug-23 22:14 
GeneralRe: Found a new way to get rid of scammers. Pin
MarkTJohnson17-Aug-23 10:02
professionalMarkTJohnson17-Aug-23 10:02 
GeneralRe: Found a new way to get rid of scammers. Pin
dandy7217-Aug-23 10:43
dandy7217-Aug-23 10:43 
GeneralRe: Found a new way to get rid of scammers. Pin
Graeme_Grant17-Aug-23 15:57
mvaGraeme_Grant17-Aug-23 15:57 
GeneralRe: Found a new way to get rid of scammers. Pin
Richard Deeming17-Aug-23 21:36
mveRichard Deeming17-Aug-23 21:36 
GeneralRe: Found a new way to get rid of scammers. Pin
Richard MacCutchan17-Aug-23 21:43
mveRichard MacCutchan17-Aug-23 21:43 
GeneralRe: Found a new way to get rid of scammers. Pin
obermd18-Aug-23 3:44
obermd18-Aug-23 3:44 
GeneralRe: Found a new way to get rid of scammers. Pin
jschell18-Aug-23 12:17
jschell18-Aug-23 12:17 
GeneralRe: Found a new way to get rid of scammers. Pin
Mycroft Holmes17-Aug-23 11:32
professionalMycroft Holmes17-Aug-23 11:32 

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.