Here you can find the source of getShortNumeric(java.nio.ByteBuffer buffer, int len)
public static short getShortNumeric(java.nio.ByteBuffer buffer, int len)
//package com.java2s; public class Main { public static short getShortNumeric(java.nio.ByteBuffer buffer, int len) { String s = ""; if (null != buffer && buffer.remaining() >= len) { byte[] dest = new byte[len]; buffer.get(dest, 0, len);// www . j ava 2 s .com s = new String(dest); } return (short) (0xFFFF & Integer.parseInt(s)); } }