本文整理汇总了Java中com.google.gwt.typedarrays.shared.Uint8Array.length方法的典型用法代码示例。如果您正苦于以下问题:Java Uint8Array.length方法的具体用法?Java Uint8Array.length怎么用?Java Uint8Array.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.typedarrays.shared.Uint8Array
的用法示例。
在下文中一共展示了Uint8Array.length方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nextChar
import com.google.gwt.typedarrays.shared.Uint8Array; //导入方法依赖的package包/类
private static int nextChar(
Uint8Array byteArray,
int pos)
{
if(pos < byteArray.length())
{
while(++pos < byteArray.length())
{
if((byteArray.get(pos) & 0xc0) != 0x80)
{
return pos;
}
}
}
return pos;
}
示例2: convertBytes
import com.google.gwt.typedarrays.shared.Uint8Array; //导入方法依赖的package包/类
public static byte[] convertBytes(ArrayBuffer buffer) {
Uint8Array array = TypedArrays.createUint8Array(buffer);
byte[] res = new byte[array.length()];
for (int i = 0; i < res.length; i++) {
res[i] = (byte) (array.get(i));
}
return res;
}
示例3: nextJavaIdentifier
import com.google.gwt.typedarrays.shared.Uint8Array; //导入方法依赖的package包/类
private int nextJavaIdentifier(
final Uint8Array byteArray,
int pos)
{
while(
(pos < byteArray.length())
&& !isJavaIdentifier(getChar(byteArray, pos)))
{
pos = nextChar(byteArray, pos);
}
return pos;
}
示例4: startsWith
import com.google.gwt.typedarrays.shared.Uint8Array; //导入方法依赖的package包/类
private int startsWith(
byte[] substringArray,
final int from,
final boolean match_case)
{
if(substringArray.length == 0)
{
return from;
}
int end = from;
int pos = 0;
Uint8Array substring = convertArray(substringArray);
for(int c0 = getChar(substring, 0); end < textByteArray.length();)
{
int c1 = getChar(textByteArray, end);
if(
(c0 != c1)
&& (match_case
|| (((c0 & 0xffff) != c0) || ((c1 & 0xffff) != c1)
|| (Character.toUpperCase((char)c0) != Character.toUpperCase(
(char)c1)))))
{
return from;
}
pos = nextChar(substring, pos);
end = nextChar(textByteArray, end);
if(pos >= substring.length())
{
return end;
}
c0 = getChar(substring, pos);
if(!isJavaIdentifier(c0))
{
c1 = getChar(textByteArray, end);
if(isJavaIdentifier(c1))
{
return from;
}
if(isspace(c0))
{
pos = skipSpaces(substring, pos);
if(pos >= substring.length())
{
return end;
}
c0 = getChar(substring, pos);
if(isJavaIdentifier(c0))
{
end = nextJavaIdentifier(textByteArray, end);
}
else
{
end = skipSpaces(textByteArray, end);
}
}
}
}
return from;
}