Here you can find the source of writeInt24(int v, ByteBuffer buffer)
public static void writeInt24(int v, ByteBuffer buffer) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.ByteBuffer; public class Main { public static void writeInt24(int v, ByteBuffer buffer) throws IOException { writeByte(v, buffer);// w w w . j av a 2s. co m writeByte(v >> 8, buffer); writeByte(v >> 16, buffer); } public static void writeByte(byte v, ByteBuffer buffer) throws IOException { buffer.put(v); } public static void writeByte(int v, ByteBuffer buffer) throws IOException { buffer.put((byte) (v & 0xFF)); } }