本文整理汇总了Java中com.sun.squawk.NativeUnsafe.getUnalignedLong方法的典型用法代码示例。如果您正苦于以下问题:Java NativeUnsafe.getUnalignedLong方法的具体用法?Java NativeUnsafe.getUnalignedLong怎么用?Java NativeUnsafe.getUnalignedLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.NativeUnsafe
的用法示例。
在下文中一共展示了NativeUnsafe.getUnalignedLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLong
import com.sun.squawk.NativeUnsafe; //导入方法依赖的package包/类
/**
* Gets the <code>long</code> at the given offset in the memory area
* associated with this object.
* <p>
* The load is not required to be atomic even it is located on a natural boundary.
* <p>
* Caching of the memory access is controlled by the memory <code>type</code> requested
* when the <code>RawMemoryAccess</code> instance was created. If the memory is not cached,
* this method guarantees serialized access (that is, the memory access at the memory
* occurs in the same order as in the program. Multiple writes to the same location
* may not be coalesced.)
*
* @param offset The offset in bytes from the beginning of the raw memory area
* from which to load the long.
*
* @throws OffsetOutOfBoundsException Thrown if the offset is invalid.
*
* @throws SizeOutOfBoundsException Thrown if the object is not mapped,
* or if the double falls in an invalid address range.
*
* @throws java.lang.SecurityException Thrown if this access is
* not permitted by the security manager.
*
* @return The long from raw memory.
*/
public long getLong(long offset) {
int off = (int)offset;
checkRead(off, 8);
return NativeUnsafe.getUnalignedLong(vbase, off);
}