Moved format byte to string function

This commit is contained in:
Ziver Koc 2016-04-26 14:24:16 +02:00
parent ea206cc5b5
commit e28c84efb3
5 changed files with 80 additions and 76 deletions

View file

@ -73,7 +73,9 @@ public class Converter {
*/
public static byte[] toBytes(char[] arr){
byte[] ret = new byte[arr.length];
System.arraycopy(arr, 0, ret, 0, arr.length);
for (int i=0; i<arr.length; ++i)
ret[i] = (byte) (arr[i] & 0xFF);
//System.arraycopy(arr, 0, ret, 0, arr.length); // does not work if char value is largen than 128
return ret;
}