From 27fc91fbe8f88b6885356e68828cfe1ce1db7601 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期三, 28 二月 2024 09:53:13 +0800
Subject: [PATCH] 坐标
---
lib/src/main/java/com/anyun/exam/lib/util/ByteUtil.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/lib/src/main/java/com/anyun/exam/lib/util/ByteUtil.java b/lib/src/main/java/com/anyun/exam/lib/util/ByteUtil.java
index 0929b60..765cc92 100644
--- a/lib/src/main/java/com/anyun/exam/lib/util/ByteUtil.java
+++ b/lib/src/main/java/com/anyun/exam/lib/util/ByteUtil.java
@@ -13,4 +13,19 @@
}
return h.toString();
}
+
+ public static String byte2hex(byte [] buffer, int length) {
+ byte [] temp = new byte[length];
+ System.arraycopy(buffer, 0, temp, 0, length);
+ return byte2hex(temp);
+ }
+
+ public static boolean allIsAscii(byte []buffer) {
+ for (int i = 0; i < buffer.length; i++) {
+ if (buffer[i] < 0x20 || buffer[i] >= 0x7F) {
+ return false;
+ }
+ }
+ return true;
+ }
}
--
Gitblit v1.8.0