Here you can find the source of byteToBytes(byte x)
Parameter | Description |
---|---|
x | a parameter |
public static byte[] byteToBytes(byte x)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013, 2015 Orange./*from w w w .ja va2 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 a byte[] collection from a single byte */ public static byte[] byteToBytes(byte x) { byte[] out = new byte[1]; out[0] = x; return out; } }