Here you can find the source of toByteArray(final byte[] bytes)
Parameter | Description |
---|---|
bytes | the array to be converted |
public static Byte[] toByteArray(final byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www .ja va 2 s . co m*/ * Produces an array of Byte objects from an array of bytes. * <p> * Can be used to produce an array of objects to feed an iterator * * @param bytes the array to be converted * @return an array of Byte objects */ public static Byte[] toByteArray(final byte[] bytes) { final Byte[] result = new Byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { result[i] = Byte.valueOf(bytes[i]); } return result; } }