added more sys utils

This commit is contained in:
nathan 2015-08-16 01:15:11 +02:00
parent 6d79f15ed7
commit a1a5b73c59
1 changed files with 13 additions and 0 deletions

View File

@ -414,6 +414,19 @@ class Sys {
return bytes;
}
public static
byte[] charToBytesRaw(char[] chars) {
int length = chars.length;
byte[] bytes = new byte[length];
for (int i = 0; i < length; i++) {
char charValue = chars[i];
bytes[i] = (byte) charValue;
}
return bytes;
}
public static
int[] bytesToInts(byte[] bytes) {
int length = bytes.length;