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


Java LongBuffer.slice方法代码示例

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


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

示例1: slice

import java.nio.LongBuffer; //导入方法依赖的package包/类
public static LongBuffer slice(LongBuffer buf) {
    LongBuffer buffer = buf.slice();
    Buffer viewedBuffer = bufferViews.get(buf);
    if (viewedBuffer != null) {
        bufferViews.put(buffer, viewedBuffer);
    }
    return buffer;
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:9,代码来源:RT.java

示例2: valueOf

import java.nio.LongBuffer; //导入方法依赖的package包/类
/**
 * Returns a new bit set containing all the bits in the given long
 * buffer between its position and limit.
 *
 * <p>More precisely,
 * <br>{@code BitSet.valueOf(lb).get(n) == ((lb.get(lb.position()+n/64) & (1L<<(n%64))) != 0)}
 * <br>for all {@code n < 64 * lb.remaining()}.
 *
 * <p>The long buffer is not modified by this method, and no
 * reference to the buffer is retained by the bit set.
 *
 * @param lb a long buffer containing a little-endian representation
 *        of a sequence of bits between its position and limit, to be
 *        used as the initial bits of the new bit set
 * @return a {@code BitSet} containing all the bits in the buffer in the
 *         specified range
 * @since 1.7
 */
public static BitSet valueOf(LongBuffer lb) {
    lb = lb.slice();
    int n;
    for (n = lb.remaining(); n > 0 && lb.get(n - 1) == 0; n--)
        ;
    long[] words = new long[n];
    lb.get(words);
    return new BitSet(words);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:BitSet.java

示例3: valueOf

import java.nio.LongBuffer; //导入方法依赖的package包/类
/**
 * Returns a new bit set containing all the bits in the given long
 * buffer between its position and limit.
 *
 * <p>More precisely,
 * <br>{@code BitSetWithMask.valueOf(lb).get(n) == ((lb.get(lb.position()+n/64) & (1L<<(n%64))) != 0)}
 * <br>for all {@code n < 64 * lb.remaining()}.
 *
 * <p>The long buffer is not modified by this method, and no
 * reference to the buffer is retained by the bit set.
 *
 * @param lb a long buffer containing a little-endian representation
 *        of a sequence of bits between its position and limit, to be
 *        used as the initial bits of the new bit set
 * @return a {@code BitSetWithMask} containing all the bits in the buffer in the
 *         specified range
 * @since 1.7
 */
public static BitSetWithMask valueOf(LongBuffer lb) {
    lb = lb.slice();
    int n;
    for (n = lb.remaining(); n > 0 && lb.get(n - 1) == 0; n--)
        ;
    long[] words = new long[n];
    lb.get(words);
    return new BitSetWithMask(words);
}
 
开发者ID:ankushs92,项目名称:Browscap4j,代码行数:28,代码来源:BitSetWithMask.java


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