当前位置: 首页>>代码示例>>C#>>正文


C# com.nextByte方法代码示例

本文整理汇总了C#中com.nextByte方法的典型用法代码示例。如果您正苦于以下问题:C# com.nextByte方法的具体用法?C# com.nextByte怎么用?C# com.nextByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com的用法示例。


在下文中一共展示了com.nextByte方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: tryMatch

 /// <exception cref="System.IO.IOException"/>
 private static com.fasterxml.jackson.core.format.MatchStrength tryMatch(com.fasterxml.jackson.core.format.InputAccessor
     acc, string matchStr, com.fasterxml.jackson.core.format.MatchStrength fullMatchStrength
     )
 {
     for (int i = 0; i < len; ++i)
     {
         if (!acc.hasMoreBytes())
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         if (acc.nextByte() != matchStr[i])
         {
             return com.fasterxml.jackson.core.format.MatchStrength.NO_MATCH;
         }
     }
     return fullMatchStrength;
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:18,代码来源:ByteSourceJsonBootstrapper.cs

示例2: skipSpace

 /// <exception cref="System.IO.IOException"/>
 private static int skipSpace(com.fasterxml.jackson.core.format.InputAccessor acc)
 {
     if (!acc.hasMoreBytes())
     {
         return -1;
     }
     return skipSpace(acc, acc.nextByte());
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:9,代码来源:ByteSourceJsonBootstrapper.cs

示例3: hasJSONFormat

 /*
 /**********************************************************
 /*  Encoding detection for data format auto-detection
 /**********************************************************
 */
 /// <summary>
 /// Current implementation is not as thorough as other functionality
 /// (
 /// <see cref="ByteSourceJsonBootstrapper"/>
 /// );
 /// supports UTF-8, for example. But it should work, for now, and can
 /// be improved as necessary.
 /// </summary>
 /// <exception cref="System.IO.IOException"/>
 public static com.fasterxml.jackson.core.format.MatchStrength hasJSONFormat(com.fasterxml.jackson.core.format.InputAccessor
     acc)
 {
     // Ideally we should see "[" or "{"; but if not, we'll accept double-quote (String)
     // in future could also consider accepting non-standard matches?
     if (!acc.hasMoreBytes())
     {
         return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
     }
     byte b = acc.nextByte();
     // Very first thing, a UTF-8 BOM?
     if (b == UTF8_BOM_1)
     {
         // yes, looks like UTF-8 BOM
         if (!acc.hasMoreBytes())
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         if (acc.nextByte() != UTF8_BOM_2)
         {
             return com.fasterxml.jackson.core.format.MatchStrength.NO_MATCH;
         }
         if (!acc.hasMoreBytes())
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         if (acc.nextByte() != UTF8_BOM_3)
         {
             return com.fasterxml.jackson.core.format.MatchStrength.NO_MATCH;
         }
         if (!acc.hasMoreBytes())
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         b = acc.nextByte();
     }
     // Then possible leading space
     int ch = skipSpace(acc, b);
     if (ch < 0)
     {
         return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
     }
     // First, let's see if it looks like a structured type:
     if (ch == '{')
     {
         // JSON object?
         // Ideally we need to find either double-quote or closing bracket
         ch = skipSpace(acc);
         if (ch < 0)
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         if (ch == '"' || ch == '}')
         {
             return com.fasterxml.jackson.core.format.MatchStrength.SOLID_MATCH;
         }
         // ... should we allow non-standard? Let's not yet... can add if need be
         return com.fasterxml.jackson.core.format.MatchStrength.NO_MATCH;
     }
     com.fasterxml.jackson.core.format.MatchStrength strength;
     if (ch == '[')
     {
         ch = skipSpace(acc);
         if (ch < 0)
         {
             return com.fasterxml.jackson.core.format.MatchStrength.INCONCLUSIVE;
         }
         // closing brackets is easy; but for now, let's also accept opening...
         if (ch == ']' || ch == '[')
         {
             return com.fasterxml.jackson.core.format.MatchStrength.SOLID_MATCH;
         }
         return com.fasterxml.jackson.core.format.MatchStrength.SOLID_MATCH;
     }
     else
     {
         // plain old value is not very convincing...
         strength = com.fasterxml.jackson.core.format.MatchStrength.WEAK_MATCH;
     }
     if (ch == '"')
     {
         // string value
         return strength;
     }
     if (ch <= '9' && ch >= '0')
     {
//.........这里部分代码省略.........
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:101,代码来源:ByteSourceJsonBootstrapper.cs


注:本文中的com.nextByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。