diff options
Diffstat (limited to 'src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java')
-rw-r--r-- | src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java b/src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java index e4c0dbd..376bcb5 100644 --- a/src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java +++ b/src/main/java/com/google/android/mobly/snippet/bundled/utils/Utils.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeoutException; public final class Utils { - private final static char[] hexArray = "0123456789abcdef".toCharArray(); + private static final char[] hexArray = "0123456789abcdef".toCharArray(); private Utils() {} @@ -194,22 +194,20 @@ public final class Utils { } /** - * Convert a byte array (binary data) to a hexadecimal string (ASCII) - * representation. - - * [\x01\x02] -> "0102" + * Convert a byte array (binary data) to a hexadecimal string (ASCII) representation. + * + * <p>[\x01\x02] -> "0102" * * @param bytes The array of byte to convert. * @return a String with the ASCII hex representation. */ public static String bytesToHexString(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; - for ( int j = 0; j < bytes.length; j++ ) { + for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } return new String(hexChars); } - } |