Here you can find the source of getShort(ByteBuffer byteBuffer)
public static int getShort(ByteBuffer byteBuffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { private static final int SHORT_PADDING = 0xFFFF; public static int getShort(ByteBuffer byteBuffer) { return (byteBuffer.getShort() & SHORT_PADDING); }/*from w w w .j a v a 2 s .c om*/ public static int getShort(ByteBuffer byteBuffer, int position) { return (byteBuffer.getShort(position) & SHORT_PADDING); } }