Here you can find the source of getNumeric(java.nio.ByteBuffer buffer, int len)
public static int getNumeric(java.nio.ByteBuffer buffer, int len)
//package com.java2s; public class Main { public static int getNumeric(java.nio.ByteBuffer buffer, int len) { String s = ""; if (null != buffer && buffer.remaining() >= len) { byte[] dest = new byte[len]; buffer.get(dest, 0, len);/*from w w w . j a v a 2s. c o m*/ s = new String(dest); } return Integer.parseInt(s); } }