Here you can find the source of toFloat24BE(ByteBuffer buf, float[] out)
private static int toFloat24BE(ByteBuffer buf, float[] out)
//package com.java2s; /**/*from w ww. ja v a2s .c o m*/ * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author Jay Codec * */ import java.nio.ByteBuffer; public class Main { public final static float r24 = 1f / 8388608f; private static int toFloat24BE(ByteBuffer buf, float[] out) { int samples = 0; while (buf.remaining() >= 3 && samples < out.length) { out[samples++] = r24 * ((((buf.get() & 0xff) << 24) | ((buf.get() & 0xff) << 16) | ((buf.get() & 0xff) << 8)) >> 8); } return samples; } }