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


Java MethodHandles.byteArrayViewVarHandle方法代码示例

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


在下文中一共展示了MethodHandles.byteArrayViewVarHandle方法的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.byteArrayViewVarHandle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。