Here you can find the source of toInt(ByteBuffer value)
public static int toInt(ByteBuffer value)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int toInt(ByteBuffer value) { int result = 0; try {//w w w . j a va 2 s . co m if (value != null) { int originPos = value.position(); result = value.getInt(); value.position(originPos); } } catch (Exception ex) { // ex.printStackTrace(); } return result; } }