コード例 #1
0
ファイル: TJSONProtocol.cs プロジェクト: cica0/SourceCode
 ///<summary>
 /// Read a byte that must match b[0]; otherwise an exception is thrown.
 /// Marked protected to avoid synthetic accessor in JSONListContext.Read
 /// and JSONPairContext.Read
 ///</summary>
 protected void ReadJSONSyntaxChar(byte[] b)
 {
     byte ch = reader.Read();
     if (ch != b[0])
     {
         throw new TProtocolException(TProtocolException.INVALID_DATA,
                                      "Unexpected character:" + (char)ch);
     }
 }
コード例 #2
0
ファイル: TSimpleJSONProtocol.cs プロジェクト: xgray/dotnet
        ///<summary>
        /// Read a byte that must match b[0]; otherwise an exception is thrown.
        /// Marked protected to avoid synthetic accessor in JSONListContext.Read
        /// and JSONPairContext.Read
        ///</summary>
        protected void ReadJSONSyntaxChar(byte[] b)
        {
            byte ch = reader.Read();

            if (ch != b[0])
            {
                throw new TProtocolException(
                          TProtocolException.INVALID_DATA,
                          "Context:" + context.ToString() +
                          " Expected character:" + (char)b[0] +
                          " Unexpected character:" + (char)ch);
            }
        }