Here you can find the source of unsignedShortAt(byte[] data, int pos)
public static final int unsignedShortAt(byte[] data, int pos)
//package com.java2s; /**//from w w w .jav a2s.c o m * Copyright (C) 2010-2014 Fabric project group, Cornell University * * This file is part of Fabric. * * Fabric is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 2 of the License, or (at your option) any later * version. * * Fabric is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. */ public class Main { /** * Returns the unsigned short that starts at the given position in the given * byte array. */ public static final int unsignedShortAt(byte[] data, int pos) { return ((data[pos + 0] & 0xff) << 8) | ((data[pos + 1] & 0xff) << 0); } }