Moved format byte to string function
This commit is contained in:
parent
ea206cc5b5
commit
e28c84efb3
5 changed files with 80 additions and 76 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue