Here you can find the source of intTo1Byte(int x)
Parameter | Description |
---|---|
x | a parameter |
public static byte[] intTo1Byte(int x)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013, 2015 Orange./*from ww w. j ava2 s . c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Victor PERRON, Antonin CHAZALET, Andre BOTTARO. *******************************************************************************/ public class Main { /** * @param x * @return intTo1Byte */ public static byte[] intTo1Byte(int x) { byte[] out = new byte[1]; out[0] = (byte) (x & 0xff); return out; } }