byte b;
if (Char.IsWhiteSpace((char) b))
{
}
EDIT . As Eric Lippert points out, this is only true if the file's encoding is plain 7-bit ASCII. In any other encoding, it skips the corresponding bytes. So you have to consider the encoding of your data.
source
to share