private static int PeekNextChar( TextReader reader, bool mandatory ) { int character = reader.Peek(); if ( mandatory && character == -1 ) { throw new RtfMultiByteEncodingException( Strings.EndOfFileInvalidCharacter ); } return character; }