當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodHandles.byteBufferViewVarHandle方法代碼示例

本文整理匯總了Java中java.lang.invoke.MethodHandles.byteBufferViewVarHandle方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodHandles.byteBufferViewVarHandle方法的具體用法?Java MethodHandles.byteBufferViewVarHandle怎麽用?Java MethodHandles.byteBufferViewVarHandle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.lang.invoke.MethodHandles的用法示例。


在下文中一共展示了MethodHandles.byteBufferViewVarHandle方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(double[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(double[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsDouble.java

示例2: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(long[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(long[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsLong.java

示例3: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(float[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(float[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsFloat.java

示例4: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(int[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(int[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsInt.java

示例5: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(char[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(char[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsChar.java

示例6: setupVarHandleSources

import java.lang.invoke.MethodHandles; //導入方法依賴的package包/類
@Override
public void setupVarHandleSources() {
    // Combinations of VarHandle byte[] or ByteBuffer
    vhss = new ArrayList<>();
    for (MemoryMode endianess : Arrays.asList(MemoryMode.BIG_ENDIAN, MemoryMode.LITTLE_ENDIAN)) {

        ByteOrder bo = endianess == MemoryMode.BIG_ENDIAN
                ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
        VarHandleSource aeh = new VarHandleSource(
                MethodHandles.byteArrayViewVarHandle(short[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(aeh);

        VarHandleSource bbh = new VarHandleSource(
                MethodHandles.byteBufferViewVarHandle(short[].class, bo),
                endianess, MemoryMode.READ_WRITE);
        vhss.add(bbh);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:VarHandleTestByteArrayAsShort.java


注:本文中的java.lang.invoke.MethodHandles.byteBufferViewVarHandle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。