Here you can find the source of charArrayToByteArray(char[] value)
Parameter | Description |
---|---|
value | char array value |
public static byte[] charArrayToByteArray(char[] value)
//package com.java2s; //License from project: Apache License public class Main { /**// w ww .j a va2 s . co m * convert char array value to byte array value * * @param value char array value * @return byte array value */ public static byte[] charArrayToByteArray(char[] value) { byte[] result = new byte[value.length]; for (int i = 0; i < value.length; i++) result[i] = (byte) value[i]; return result; } }