Here you can find the source of fromIntWithPrefix(byte prefix, int v)
public static byte[] fromIntWithPrefix(byte prefix, int v)
//package com.java2s; /**//from w w w .j a v a 2 s.c o m * 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 byte[] fromIntWithPrefix(byte prefix, int v) { return new byte[] { prefix, (byte) ((v >> 24) & 0xff), (byte) ((v >> 16) & 0xff), (byte) ((v >> 8) & 0xff), (byte) ((v >> 0) & 0xff), }; } }