本文整理汇总了Java中com.sun.squawk.Vm2c类的典型用法代码示例。如果您正苦于以下问题:Java Vm2c类的具体用法?Java Vm2c怎么用?Java Vm2c使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vm2c类属于com.sun.squawk包,在下文中一共展示了Vm2c类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: grow
import com.sun.squawk.Vm2c; //导入依赖的package包/类
/**
* Grows the bit set.
*
* @param bitIndex the index of the bit being accessed that caused the growth
* @param bytesRequired the minimum new size
* @throws IndexOutOfBoundsException if this is an {@link #areBitsExternal() external}
* BitSet instance and <code>bitIndex >= this.size()</code>
*/
/*if[JAVA5SYNTAX]*/
@Vm2c(code="fatalVMError(\"cannot grow bit set\");")
/*end[JAVA5SYNTAX]*/
private void grow(int bitIndex, int bytesRequired) throws IndexOutOfBoundsException {
// Cannot grow a bit set whose bits are external
if (bitsAreExternal) {
throw new IndexOutOfBoundsException();
}
// Allocate larger of doubled size or required size
int request = Math.max(2 * bits.length, bytesRequired);
byte newBits[] = new byte[request];
System.arraycopy(bits, 0, newBits, 0, bytesInUse);
bits = newBits;
}
示例2: grow
import com.sun.squawk.Vm2c; //导入依赖的package包/类
/**
* Grows the bit set.
*
* @param bitIndex the index of the bit being accessed that caused the growth
* @param bytesRequired the minimum new size
* @throws IndexOutOfBoundsException if this is an {@link #areBitsExternal() external}
* BitSet instance and <code>bitIndex >= this.size()</code>
*/
@Vm2c(code="fatalVMError(\"cannot grow bit set\");")
private void grow(int bitIndex, int bytesRequired) throws IndexOutOfBoundsException {
// Cannot grow a bit set whose bits are external
if (bitsAreExternal) {
throw new IndexOutOfBoundsException();
}
// Allocate larger of doubled size or required size
int request = Math.max(2 * bits.length, bytesRequired);
byte newBits[] = new byte[request];
System.arraycopy(bits, 0, newBits, 0, bytesInUse);
bits = newBits;
}