From 72eb175dc3db0a9426455092cd96676a5a4b03b2 Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Fri, 25 Sep 2020 22:03:19 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index 0825e9e7a..7cfe4a9a9 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -1656,6 +1656,22 @@ public final class Utility { return ld.atStartOfDay(zid).toInstant().toEpochMilli(); } + /** + * 将int[]强制转换成byte[] + * + * @param value int[] + * + * @return byte[] + */ + public static byte[] intsToBytes(int[] value) { + if (value == null) return null; + byte[] bs = new byte[value.length]; + for (int i = 0; i < bs.length; i++) { + bs[i] = (byte) value[i]; + } + return bs; + } + /** * MD5加密 *