Here you can find the source of getByte(ByteBuffer byteBuffer)
public static short getByte(ByteBuffer byteBuffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { private static final int BYTE_PADDING = 0xFF; public static short getByte(ByteBuffer byteBuffer) { return (short) (byteBuffer.get() & BYTE_PADDING); }//from ww w .java2s . co m public static short getByte(ByteBuffer byteBuffer, int position) { return (short) (byteBuffer.get(position) & (short) BYTE_PADDING); } }