當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。