Here you can find the source of setSInt(ByteBuffer buffer, int data)
public static void setSInt(ByteBuffer buffer, int data)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static void setSInt(ByteBuffer buffer, int data) { assert (buffer.capacity() - buffer.position() >= 4); buffer.put((byte) (data & 0x000000ffl)); buffer.put((byte) ((data & 0x0000ff00l) >> 8)); buffer.put((byte) ((data & 0x00ff0000l) >> 16)); buffer.put((byte) ((data & 0xff000000l) >> 24)); }/*from w ww. j a va 2 s. co m*/ }