本文整理汇总了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;
}
示例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());
}
示例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')
{
//.........这里部分代码省略.........