Java tutorial
//package com.java2s; /** * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author The JCodec project * */ import java.nio.ByteBuffer; public class Main { public static int[] getAsIntArray(ByteBuffer yuv, int size) { byte[] b = new byte[size]; int[] result = new int[size]; yuv.get(b); for (int i = 0; i < b.length; i++) { result[i] = b[i] & 0xff; } return result; } }