Here you can find the source of toIntWithPrefix(byte prefix, byte[] bytes)
public static int toIntWithPrefix(byte prefix, byte[] bytes)
//package com.java2s; /**/*from w ww . j a va2 s . c om*/ * Copyright 2012-2013 Johns Hopkins University HLTCOE. All rights reserved. * This software is released under the 2-clause BSD license. * See LICENSE in the project root directory. */ public class Main { public static int toIntWithPrefix(byte prefix, byte[] bytes) { assert (bytes[0] == prefix); assert (bytes.length >= 5); return (int) ((0xff & bytes[1]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[3]) << 8 | (0xff & bytes[4]) << 0); } }