Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import java.nio.IntBuffer;

public class Main {
    public static IntBuffer makeIntBuffer(int[] array)
    /*     */ {
        /*  52 */int integerSize = 4;
        /*  53 */ByteBuffer byteBuffer = ByteBuffer.allocateDirect(array.length * 4);
        /*  54 */byteBuffer.order(ByteOrder.nativeOrder());
        /*  55 */IntBuffer intBuffer = byteBuffer.asIntBuffer();
        /*  56 */intBuffer.put(array);
        /*  57 */intBuffer.position(0);
        /*  58 */return intBuffer;
        /*     */}
}