private byte SkipSpaces( Stream stream )
{
byte nextByte = (byte) stream.ReadByte( );
while ( ( nextByte == ' ' ) || ( nextByte == '\n' ) || ( nextByte == '\r' ) || ( nextByte == '\t' ) )
{
nextByte = (byte) stream.ReadByte( );
}
if ( nextByte == '#' )
{
// read until new line
while ( nextByte != '\n' )
{
nextByte = (byte) stream.ReadByte( );
}
// skip pending spaces or another comment
return SkipSpaces( stream );
}
return nextByte;
}