convert Byte Array To Int Array using ByteBuffer - Android java.nio

Android examples for java.nio:ByteBuffer

Description

convert Byte Array To Int Array using ByteBuffer

Demo Code


//package com.java2s;

import java.nio.ByteBuffer;

public class Main {
    public static void convertByteArrayToIntArray(byte[] in, int[] out) {
        ByteBuffer byteb = ByteBuffer.wrap(in);
        for (int i = 0; i < out.length; ++i) {
            out[i] = byteb.getInt();//w  w w.j a v a 2  s  .  c  o m
        }
    }
}

Related Tutorials