Here you can find the source of getByteAsShort(java.nio.ByteBuffer buffer)
public static short getByteAsShort(java.nio.ByteBuffer buffer)
//package com.java2s; public class Main { public static short getByteAsShort(java.nio.ByteBuffer buffer) { return (short) (0xFF & buffer.get()); }//w w w .ja v a 2s.c o m }