From ee711d38f66222915bc81332c98af677fa5cd96c Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 16 七月 2024 22:17:02 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java |  802 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 469 insertions(+), 333 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
index 7b06e4d..6819327 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
@@ -9,7 +9,7 @@
 	 * 灏嗗瓧鑺傛暟缁勫悎骞跺埌瀛楄妭鏁扮粍涓�
 	 * @param bGroup1 琚悎骞舵暟缁�
 	 * @param bGroup2 鍚堝苟鏁扮粍
-	 * @return 鍚堝苟鍚庢暟缁�
+	 * @return 杩斿洖 鍚堝苟鍚庢暟缁�
 	 */
 	public static byte[] bytesMerge(byte[] bGroup1, byte[] bGroup2){
 		if(bGroup1 == null && bGroup2 == null){
@@ -29,71 +29,47 @@
 
 	/**
 	 * 鍒ゆ柇鎵�鏈夊瓧鑺傛槸鍚︿负0xFF
-	 * @param bs
-	 * @param index
-	 * @param len
-	 * @return
-	 * @throws Exception
+	 * @param bs 瀛楄妭鏁扮粍
+	 * @param index 涓嬫爣浣�
+	 * @param len 闀垮害
+	 * @return 杩斿洖 杩斿洖
 	 */
-	public static boolean bytesIsAll0xFF(byte[] bs, int index, int len)throws Exception {
+	public static boolean bytesIsAll0xFF(byte[] bs, int index, int len){
 		int count = 0 ;
 		for(int i = index; i < index + len; i++){
 			if(bs[i] == (byte)0xFF){
 				count++ ;
 			}
 		}
-		return count==len?true:false ;
+		return count == len;
 	}
-	
+
 	/**
 	 * 浜岃繘鍒惰浆鍗佽繘鍒舵暟
-	 * @param str
-	 * @return
-	 * @throws Exception
+	 * @param str 浜岃繘鍒跺瓧绗︿覆
+	 * @return 杩斿洖
 	 */
-	public static int binary2Int(String str) throws Exception {
-        int cnt=0;
-        int sum=0;
-        str=new StringBuilder(str).reverse().toString();//鍙嶈浆瀛楃涓�
-        for(int i=0;i<str.length();i++){
-            cnt++;
-            if (str.charAt(i)=='1'){
-                int mul=1;
-                for (int j=1;j<cnt;j++){
-                    mul*=2;
-                }
-                sum+=mul;
-            }
-            else continue;
-        }
-        return sum;
+	public static int binary2Int(String str) {
+		return Integer.parseInt(str, 2);
     }
 
-	
+
 	/**
 	 * 瀛楄妭杞瓨浜岃繘鍒�
-	 * 
+	 *
 	 * @param b byte
-	 * @throws Exception
-	 * @return String
+	 * @return 杩斿洖 String
 	 */
-	public static String byte2Binary(byte b) throws Exception {
-		int n = (b + 256) % 256 + 256;
-		try {
-			return Integer.toBinaryString(n).substring(1);
-		} catch (Exception e) {
-			throw new Exception("瀛楄妭杞崲鎴愪簩杩涘埗鐨勫瓧绗︿覆鍑洪敊锛�", null);
-		}
+	public static String byte2Binary(byte b) {
+		return Integer.toBinaryString(b & 0xFF) ;
 	}
 	/**
 	 * 瀛楄妭杞瓨8浣嶄簩杩涘埗
-	 * 
-	 * @param b
-	 *            byte
-	 * @throws Exception
-	 * @return String
+	 *
+	 * @param b  byte
+	 * @return 杩斿洖 String
 	 */
-	public static String byte2bit8Binary(byte b) throws Exception {
+	public static String byte2bit8Binary(byte b) {
 		String s = byte2Binary(b);
 		int len = s.length();
 		for (int i = 0; i < 8 - len; i++) {
@@ -101,15 +77,13 @@
 		}
 		return s;
 	}
-	
+
 	/**
-	 * 瀛楄妭鍙朾it
-	 * @param b
-	 * @param index
-	 * @throws Exception
-	 * @return String
+	 * 瀛楄妭鏁� 鍙栧嚭8涓猙it
+	 * @param b 瀛楄妭鏁�
+	 * @return 杩斿洖 String
 	 */
-	public static byte[] getBit(byte b) throws Exception {
+	public static byte[] getBit(byte b) {
 		byte[] bs = new byte[8] ;
 		bs[0] = (byte)(b & 1) ;
 		bs[1] = (byte)((b & 2) >> 1) ;
@@ -123,11 +97,11 @@
 	}
 
 	/**
-	 * 瀛楄妭鍙朾it
-	 * @param b
-	 * @param index
-	 * @throws Exception
-	 * @return String
+	 * 瀛楄妭鏁� 鍙栧嚭bit
+	 * @param b 瀛楄妭鏁�
+	 * @param index 涓嬫爣浣�
+	 * @throws Exception 寮傚父
+	 * @return 杩斿洖 String
 	 */
 	public static byte getBit(byte b, byte index) throws Exception {
 		if(index == 0){
@@ -153,11 +127,11 @@
 
 	/**
 	 * 涓�涓瓧鑺傝浆姝f暣鏁�
-	 * 
+	 *
 	 * @param b
 	 *            byte
-	 * @throws Exception
-	 * @return String
+	 * @throws Exception 寮傚父
+	 * @return 杩斿洖 String
 	 */
 	public static Short byte2PlusInt(byte b) throws Exception {
 		short v = b ;
@@ -167,19 +141,18 @@
 		return v ;
 	}
 
-	
+
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * double杞崲byte
-	 * @param bs byte[]
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
 	 * @param value double double绫诲瀷鐨勫弬鏁�
-	 * @param from int
+	 * @param from 寮�濮嬩綅 int
 	 */
 	public static void double2Bytes_BE(byte[] bs, double value, int from)throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
 		if (b) {
-			Long l = Double.doubleToLongBits(value);
-			long2Bytes_BE(bs, l, from);
+			long2Bytes_BE(bs, Double.doubleToLongBits(value), from);
 		} else {
 			throw new Exception("double2Bytes鏃舵暟缁勮秺鐣�");
 		}
@@ -188,15 +161,14 @@
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * double杞崲byte锛屽瓧鑺傞『搴忔槸鍊掔殑
-	 * @param bs byte[]
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
 	 * @param value double double绫诲瀷鐨勫弬鏁�
-	 * @param from int
+	 * @param from 寮�濮嬩綅 int
 	 */
 	public static void double2Bytes_LE(byte[] bs, double value, int from)throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
 		if (b) {
-			Long l = Double.doubleToLongBits(value);
-			long2Bytes_LE(bs, l, from);
+			long2Bytes_LE(bs, Double.doubleToLongBits(value), from);
 		} else {
 			throw new Exception("double2Bytes鏃舵暟缁勮秺鐣�");
 		}
@@ -205,8 +177,8 @@
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * byte杞崲double
-	 * @param bs byte[]
-	 * @param from int
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
 	 */
 	public static double bytes2Double_BE(byte[] bs, int from) throws Exception {
 		long l = bytes2Long_BE(bs, from);
@@ -216,8 +188,8 @@
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * byte杞崲double锛屽瓧鑺傞『搴忔槸鍊掔殑
-	 * @param bs byte[]
-	 * @param from int
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
 	 */
 	public static double bytes2Double_LE(byte[] bs, int from) throws Exception {
 		long l = bytes2Long_LE(bs, from);
@@ -306,7 +278,7 @@
 
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
-	 * 杞崲long鍨嬩负byte鏁扮粍 
+	 * 杞崲long鍨嬩负byte鏁扮粍
 	 * @value bs byte[]
 	 * @value value long
 	 * @value from int
@@ -315,8 +287,8 @@
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
 		if (b) {
 			for (int i = 0; i < 8; i++) {
-				bs[from + i] = Long.valueOf(value & 0xff).byteValue(); 
-				value = value >> 8;  
+				bs[from + i] = Long.valueOf(value & 0xff).byteValue();
+				value = value >> 8;
 			if(value == 0){
 				break ;
 			}
@@ -325,12 +297,12 @@
 			throw new Exception("long2Bytes鏃舵暟缁勮秺鐣�");
 		}
 	}
-	
+
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
-	 * @param bs byte[]
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_BE(byte[] bs) {
 		int len = bs.length ;
@@ -338,7 +310,7 @@
 			long l = 0;
 			long[] ls = new long[len] ;
 			for(int i = 0 ; i < len; i++){
-				ls[i] = bs[i] ;
+				ls[i] = bs[i] & 0xFF ;
 			}
 			for(int i = len-1 ; i >= 0; i--){
 				ls[(len - 1) - i] <<= 8 * i ;
@@ -347,29 +319,29 @@
 				l = l | ls[i] ;
 			}
 			return l;
-		} 
+		}
 		return 0L ;
 	}
-		
+
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
-	 * @param bs byte[]
-	 * @param from int
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_BE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
 		if (b) {
 			long s = 0;
-			long s0 = bs[from + 0] ;// 鏈�浣庝綅
-			long s1 = bs[from + 1] ;
-			long s2 = bs[from + 2] ;
-			long s3 = bs[from + 3] ;
-			long s4 = bs[from + 4] ;
-			long s5 = bs[from + 5] ;
-			long s6 = bs[from + 6] ;
-			long s7 = bs[from + 7] ;
+			long s0 = bs[from + 0] & 0xFF ;// 鏈�浣庝綅
+			long s1 = bs[from + 1] & 0xFF ;
+			long s2 = bs[from + 2] & 0xFF ;
+			long s3 = bs[from + 3] & 0xFF ;
+			long s4 = bs[from + 4] & 0xFF ;
+			long s5 = bs[from + 5] & 0xFF ;
+			long s6 = bs[from + 6] & 0xFF ;
+			long s7 = bs[from + 7] & 0xFF ;
 
 			// s7涓嶅彉
 			s6 <<= 8;
@@ -388,10 +360,10 @@
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
-	 * @param bs byte[]
-	 * @param from int
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
 	 * @param end int
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_BE(byte[] bs, int from, int end) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, end);
@@ -399,7 +371,7 @@
 			short len = (short)(end - from + 1) ;
 			long[] ls = new long[len] ;
 			for(short i = 0 ; i < len; i++){
-				ls[i] = bs[from + i] ;
+				ls[i] = bs[from + i] & 0xFF ;
 			}
 			for(short i = (short)(len-1) ; i >= 0; i--){
 				ls[i] <<= 8 * (len - (i + 1)) ;
@@ -414,13 +386,13 @@
 		}
 	}
 
-	
-	
+
+
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
-	 * @param bs byte[]
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_LE(byte[] bs) {
 		int len = bs.length ;
@@ -428,7 +400,7 @@
 			long l = 0;
 			long[] ls = new long[len] ;
 			for(int i = 0 ; i < len; i++){
-				ls[i] = bs[i] ;
+				ls[i] = bs[i] & 0xFF ;
 			}
 			for(int i = 0 ; i < len; i++){
 				ls[(len - 1) - i] <<= 8 * i ;
@@ -437,29 +409,29 @@
 				l = l | ls[i] ;
 			}
 			return l;
-		} 
+		}
 		return 0L ;
 	}
 
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
-	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� 
-	 * @param bs byte[]
-	 * @param from int
-	 * @return
+	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_LE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
 		if (b) {
 			long s = 0;
-			long s0 = bs[from + 0] ;// 鏈�浣庝綅
-			long s1 = bs[from + 1] ;
-			long s2 = bs[from + 2] ;
-			long s3 = bs[from + 3] ;
-			long s4 = bs[from + 4] ;
-			long s5 = bs[from + 5] ;
-			long s6 = bs[from + 6] ;
-			long s7 = bs[from + 7] ;
+			long s0 = bs[from] & 0xFF ;// 鏈�浣庝綅
+			long s1 = bs[from + 1] & 0xFF ;
+			long s2 = bs[from + 2] & 0xFF ;
+			long s3 = bs[from + 3] & 0xFF ;
+			long s4 = bs[from + 4] & 0xFF ;
+			long s5 = bs[from + 5] & 0xFF ;
+			long s6 = bs[from + 6] & 0xFF ;
+			long s7 = bs[from + 7] & 0xFF ;
 
 			// s0涓嶅彉
 			s1 <<= 8;
@@ -479,10 +451,10 @@
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨�
-	 * @param bs byte[]
-	 * @param from int
+	 * @param bs 瀛楄妭鏁扮粍 byte[]
+	 * @param from 寮�濮嬩綅 int
 	 * @param end int
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static long bytes2Long_LE(byte[] bs, int from, int end) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, end);
@@ -490,7 +462,7 @@
 			short len = (short)(end - from + 1) ;
 			long[] ls = new long[len] ;
 			for(short i = 0 ; i < len; i++){
-				ls[i] = bs[from + i] ;
+				ls[i] = bs[from + i] & 0xFF ;
 			}
 			for(short i = 0 ; i < len; i++){
 				ls[i] <<= 8 * i ;
@@ -539,9 +511,9 @@
 			for (int i = 0; i < 4; i++) {
 				bs[from + i] = Integer.valueOf(value & 0xff).byteValue();// 灏嗘渶浣庝綅淇濆瓨鍦ㄤ綆瀛楄妭
 				value = value >> 8; // 鍚戝彸绉�8浣�
-			if(value == 0){
-				break ;
-			}
+				if(value == 0){
+					break ;
+				}
 			}
 		} else {
 			throw new Exception("int2Bytes鏃舵暟缁勮秺鐣�");
@@ -551,17 +523,18 @@
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 4浣嶅瓧鑺傛暟缁勮浆鎹负鏁村瀷
-	 * @param b
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍
+	 * @param from 寮�濮嬩綅
+	 * @return 杩斿洖
 	 */
 	public static int bytes2Int_BE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 4);
 		if (b) {
 			int s = 0;
-			int s0 = bs[from + 0] ;// 鏈�浣庝綅
-			int s1 = bs[from + 1] ;
-			int s2 = bs[from + 2] ;
-			int s3 = bs[from + 3] ;
+			int s0 = bs[from + 0] & 0xFF ;// 鏈�浣庝綅
+			int s1 = bs[from + 1] & 0xFF ;
+			int s2 = bs[from + 2] & 0xFF ;
+			int s3 = bs[from + 3] & 0xFF ;
 
 			// s3涓嶅彉
 			s2 <<= 8;
@@ -573,22 +546,22 @@
 			throw new Exception("byte2Int鏃舵暟缁勮秺鐣�");
 		}
 	}
-	
+
 
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 4浣嶅瓧鑺傛暟缁勮浆鎹负鏁村瀷锛屽瓧鑺傞『搴忔槸鍊掔殑
-	 * @param b
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍
+	 * @return 杩斿洖
 	 */
 	public static int bytes2Int_LE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 4);
 		if (b) {
 			int s = 0;
-			int s0 = bs[from + 0] ;// 鏈�浣庝綅
-			int s1 = bs[from + 1] ;
-			int s2 = bs[from + 2] ;
-			int s3 = bs[from + 3] ;
+			int s0 = bs[from + 0] & 0xFF ;// 鏈�浣庝綅
+			int s1 = bs[from + 1] & 0xFF ;
+			int s2 = bs[from + 2] & 0xFF ;
+			int s3 = bs[from + 3] & 0xFF ;
 
 			// s0涓嶅彉
 			s1 <<= 8;
@@ -600,7 +573,7 @@
 			throw new Exception("byte2Int鏃舵暟缁勮秺鐣�");
 		}
 	}
-	
+
 
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
@@ -674,15 +647,15 @@
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 2浣嶅瓧鑺傛暟缁勮浆鎹负鐭暣鍨�
-	 * @param b
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍
+	 * @return 杩斿洖
 	 */
 	public static short bytes2Short_BE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 2);
 		if (b) {
 			int s = 0;
-			int s0 = bs[from + 0] ; 
-			int s1 = bs[from + 1] ;
+			int s0 = bs[from + 0] & 0xFF ;
+			int s1 = bs[from + 1] & 0xFF ;
 
 			// s1涓嶅彉
 			s0 <<= 8;
@@ -697,15 +670,15 @@
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 2浣嶅瓧鑺傛暟缁勮浆鎹负鐭暣鍨嬶紝瀛楄妭椤哄簭鏄�掔殑
-	 * @param b
-	 * @return
+	 * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍
+	 * @return 杩斿洖
 	 */
 	public static short bytes2Short_LE(byte[] bs, int from) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + 2);
 		if (b) {
 			int s = 0;
-			int s0 = bs[from + 0] ; 
-			int s1 = bs[from + 1] ;
+			int s0 = bs[from + 0] & 0xFF ;
+			int s1 = bs[from + 1] & 0xFF ;
 
 			// s0涓嶅彉
 			s1 <<= 8;
@@ -718,11 +691,11 @@
 	}
 	/**
 	 * 瀛楃鍒颁竴瀛楄妭杞崲
-	 * 
+	 *
 	 * @value bs byte[]
 	 * @value ch char char绫诲瀷鐨勫弬鏁�
 	 * @value index int
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static void char2Bytes(byte[] bs, char ch, int index)throws Exception {
 		boolean b = isOutOfArrLength(bs.length, index);
@@ -735,10 +708,9 @@
 
 	/**
 	 * 涓�瀛楄妭杞崲涓哄瓧绗�
-	 * 
-	 * @param b
+	 * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍
 	 * @value index int
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static char bytes2Char(byte[] bs, int index) throws Exception {
 		boolean b = isOutOfArrLength(bs.length, index);
@@ -751,13 +723,13 @@
 
 	/**
 	 * 瀛楃涓插瀷鏁板瓧杞垚byte
-	 * 
+	 *
 	 * @param s
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static byte string2byte(String s) throws Exception {
-		int n = 0;
+		int n ;
 		try {
 			n = Integer.parseInt(s);
 		} catch (Exception e) {
@@ -772,7 +744,7 @@
 	 * @value bs byte[]
 	 * @value str String
 	 * @value from int
-	 * @return
+	 * @return 杩斿洖
 	 * @throws java.io.UnsupportedEncodingException
 	 */
 	public static int string2Bytes_BE(byte[] bs, String str, int from, int end)throws Exception {
@@ -798,7 +770,7 @@
 	 * @value bs byte[]
 	 * @value str String
 	 * @value from int
-	 * @return
+	 * @return 杩斿洖
 	 * @throws java.io.UnsupportedEncodingException
 	 */
 	public static int string2Bytes_LE(byte[] bs, String str, int from, int end)throws Exception {
@@ -824,7 +796,7 @@
 	 * @value bs byte[]
 	 * @value str String
 	 * @value from int
-	 * @return
+	 * @return 杩斿洖
 	 * @throws java.io.UnsupportedEncodingException
 	 */
 	public static int string2Bytes_BE(byte[] bs, String str, int from)throws Exception {
@@ -846,7 +818,7 @@
 	 * @value bs byte[]
 	 * @value str String
 	 * @value from int
-	 * @return
+	 * @return 杩斿洖
 	 * @throws java.io.UnsupportedEncodingException
 	 */
 	public static int string2Bytes_LE(byte[] bs, String str, int from)throws Exception {
@@ -898,10 +870,10 @@
 
 	/**
 	 * 鍒ゆ柇鏁扮粍涓嬫爣鏄惁瓒婄晫
-	 * 
+	 *
 	 * @value bsLength 鏁扮粍鎬婚暱搴�
 	 * @value toSite 鏁扮粍鍋忕Щ閲�
-	 * @return
+	 * @return 杩斿洖
 	 */
 	private static boolean isOutOfArrLength(int bsLength, int toSite) {
 		if (bsLength > toSite) {
@@ -911,158 +883,300 @@
 		}
 	}
 
-	
+
 	/**
-	 * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� 
-	 * 
-	 * @param b byte[]
+	 * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓�
+	 *
+	 * @param src byte[]
 	 * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅�
-	 * @return String
+	 * @return 杩斿洖 String
 	 */
-	public static String bytes2Hex(byte[] src, boolean hasBlank){  
-	    StringBuilder stringBuilder = new StringBuilder("");  
-	    if (src == null || src.length <= 0) {  
-	        return null;  
-	    }  
-	    for (int i = 0; i < src.length; i++) {  
-	        int v = src[i] & 0xFF;  
-	        String str = Integer.toHexString(v);  
-	        if (str.length() < 2) {  
-	        	str = "0" + str;
-	        }  
-			if (hasBlank) {
-				if (i == 0) {
-					stringBuilder.append(str);  
-				} else {
-					stringBuilder.append(" " + str);  
-				}
-			} else {
-				stringBuilder.append(str); 
-			}
-	    }  
-	    return stringBuilder.toString().toUpperCase(Locale.US);
-	}  
+	public static String bytes2Hex(byte[] src, boolean hasBlank){
+	    return bytes2Hex_BE(src, hasBlank) ;
+	}
+
+    /**
+     * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓�
+     *
+     * @param src byte[]
+     * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅�
+     * @return 杩斿洖 String
+     */
+    public static String bytes2Hex_BE(byte[] src, boolean hasBlank){
+        StringBuilder stringBuilder = new StringBuilder("");
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        for (int i = 0; i < src.length; i++) {
+            int v = src[i] & 0xFF;
+            String str = Integer.toHexString(v);
+            if (str.length() < 2) {
+                str = "0" + str;
+            }
+            if (hasBlank) {
+                if (i == 0) {
+                    stringBuilder.append(str);
+                } else {
+                    stringBuilder.append(" " + str);
+                }
+            } else {
+                stringBuilder.append(str);
+            }
+        }
+        return stringBuilder.toString().toUpperCase(Locale.US);
+    }
+    /**
+     * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓�
+     *
+     * @param src byte[]
+     * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅�
+     * @return 杩斿洖 String
+     */
+    public static String bytes2Hex_LE(byte[] src, boolean hasBlank){
+        StringBuilder stringBuilder = new StringBuilder("");
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        for (int i = src.length - 1 ; i >= 0; i--) {
+            int v = src[i] & 0xFF;
+            String str = Integer.toHexString(v);
+            if (str.length() < 2) {
+                str = "0" + str;
+            }
+            if (hasBlank) {
+                if (i == 0) {
+                    stringBuilder.append(str);
+                } else {
+                    stringBuilder.append(" " + str);
+                }
+            } else {
+                stringBuilder.append(str);
+            }
+        }
+        return stringBuilder.toString().toUpperCase(Locale.US);
+    }
 	/**
-	 * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� 
-	 * 
-	 * @param b byte[]
+	 * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓�
+	 *
+	 * @param bs byte[]
 	 * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅�
-	 * @param from  
-	 * @param len 
-	 * @return String
+	 * @param from 寮�濮嬩綅
+	 * @param len 闀垮害
+	 * @return 杩斿洖 String
 	 */
-	public static String bytes2Hex(byte[] src, boolean hasBlank, int from, int len){  
-	    if (src == null || src.length <= 0 || src.length < from + len) {  
-	        return null;  
-	    }  
+	public static String bytes2Hex(byte[] bs, boolean hasBlank, int from, int len){
+	    if (bs == null || bs.length <= 0 || bs.length < from + len) {
+	        return null;
+	    }
 		byte[] bb = new byte[len];
 		for (int i = 0 ; i < len; i++) {
-			bb[i] = src[from + i];
+			bb[i] = bs[from + i];
 		}
 	    return bytes2Hex(bb, hasBlank) ;
-	}  
-	/** 
+	}
+    /**
+     * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓�
+     *
+     * @param bs byte[]
+     * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅�
+     * @param from 寮�濮嬩綅
+     * @param len 闀垮害
+     * @return 杩斿洖 String
+     */
+    public static String bytes2Hex_LE(byte[] bs, boolean hasBlank, int from, int len){
+        if (bs == null || bs.length <= 0 || bs.length < from + len) {
+            return null;
+        }
+        byte[] bb = new byte[len];
+        for (int i = 0 ; i < len; i++) {
+            bb[i] = bs[from + i];
+        }
+        return bytes2Hex_LE(bb, hasBlank) ;
+    }
+	/**
 	 * 鍗佸叚杩涘埗杞瓧鑺傛暟缁�
-	 * @param hexString the hex string 
-	 * @return byte[] 
-	 */  
-	public static byte[] hex2Bytes(String hex) {  
-	    if (hex == null || hex.equals("")) {  
-	        return null;  
-	    }  
-	    hex = hex.toUpperCase(Locale.ENGLISH);  
-	    int length = hex.length() / 2;  
-	    char[] hexChars = hex.toCharArray();  
-	    byte[] d = new byte[length];  
-	    for (int i = 0; i < length; i++) {  
-	        int pos = i * 2;  
-	        d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));  
-	    }  
-	    return d;  
-	}  
-	/** 
+	 * @param hex the hex string
+	 * @return 杩斿洖 byte[]
+	 */
+	public static byte[] hex2Bytes(String hex) {
+	    if (hex == null || hex.equals("")) {
+	        return null;
+	    }
+	    hex = hex.toUpperCase(Locale.ENGLISH);
+	    int length = hex.length() / 2;
+	    char[] hexChars = hex.toCharArray();
+	    byte[] d = new byte[length];
+	    for (int i = 0; i < length; i++) {
+	        int pos = i * 2;
+	        d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
+	    }
+	    return d;
+	}
+	/**
 	 * 鍗佸叚杩涘埗杞瓧鑺傛暟缁�
-	 * @param hexString the hex string 
-	 * @return byte[] 
-	 */  
-	public static int hex2Bytes(String hex, byte[] bs, int fromIndex) {  
-	    if (hex == null || hex.equals("")) {  
-	        return fromIndex;  
-	    }  
-	    hex = hex.toUpperCase(Locale.ENGLISH);  
-	    int length = hex.length() / 2;  
-	    char[] hexChars = hex.toCharArray();  
-	    byte[] d = new byte[length];  
-	    for (int i = 0; i < length; i++) {  
-	        int pos = i * 2;  
-	        d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));  
+	 * @param hex the hex string
+	 * @return 杩斿洖 byte[]
+	 */
+	public static int hex2Bytes(String hex, byte[] bs, int fromIndex) {
+	    if (hex == null || hex.equals("")) {
+	        return fromIndex;
+	    }
+	    hex = hex.toUpperCase(Locale.ENGLISH);
+	    int length = hex.length() / 2;
+	    char[] hexChars = hex.toCharArray();
+	    byte[] d = new byte[length];
+	    for (int i = 0; i < length; i++) {
+	        int pos = i * 2;
+	        d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
 	    }
 	    for(int i = 0 ; i < d.length; i++){
 	    	bs[fromIndex++] = d[i] ;
 	    }
-	    return fromIndex ;  
-	} 
+	    return fromIndex ;
+	}
+
+	/**
+	 * 鍗佸叚杩涘埗杞瓧鑺傛暟缁�
+	 * @param hex the hex string
+	 * @return 杩斿洖 byte[]
+	 */
+	public static int hex2Bytes_LE(String hex, byte[] bs, int fromIndex) {
+		if (hex == null || hex.equals("")) {
+			return fromIndex;
+		}
+		hex = hex.toUpperCase(Locale.ENGLISH);
+		int length = hex.length() / 2;
+		char[] hexChars = hex.toCharArray();
+		byte[] d = new byte[length];
+		for (int i = 0; i < length; i++) {
+			int pos = i * 2;
+			d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
+		}
+		for(int i = 0 ; i < d.length; i++){
+			bs[fromIndex++] = d[(d.length - 1) - i] ;
+		}
+		return fromIndex ;
+	}
+
+
 
 	private static final char[] HEX_CHAR = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-	/**
-	 * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
-	 *
-	 * @param bytes 寰呰浆鎹yte[]
-	 * @return 杞崲鍚庣殑瀛楃涓�
-	 */
-	public static String bytesToHex(byte[] bytes) {
-		//涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
-		char[] buf = new char[bytes.length * 2];
-		int a = 0;
-		int index = 0;
-		for (byte b : bytes) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
-			if (b < 0) {
-				a = 256 + b;
-			} else {
-				a = b;
-			}
-
-			buf[index++] = HEX_CHAR[a / 16];
-			buf[index++] = HEX_CHAR[a % 16];
-		}
-		return new String(buf);
-	}
-
-	/**
-	 * 灏�16杩涘埗瀛楃涓茶浆鎹负byte[]
-	 *
-	 * @param str 寰呰浆鎹㈠瓧绗︿覆
-	 * @return 杞崲鍚庣殑byte[]
-	 */
-	public static byte[] hexToBytes(String str) {
-		if (str == null || "".equals(str.trim())) {
-			return new byte[0];
-		}
-
-		byte[] bytes = new byte[str.length() / 2];
-		for (int i = 0; i < str.length() / 2; i++) {
-			String subStr = str.substring(i * 2, i * 2 + 2);
-			bytes[i] = (byte) Integer.parseInt(subStr, 16);
-		}
-
-		return bytes;
-	}
+//	/**
+//	 * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
+//	 *
+//	 * @param bytes 寰呰浆鎹yte[]
+//	 * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
+//	 */
+//	public static String bytesToHex(byte[] bytes) {
+//		//涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
+//		char[] buf = new char[bytes.length * 2];
+//		int a = 0;
+//		int index = 0;
+//		for (byte b : bytes) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
+//			if (b < 0) {
+//				a = 256 + b;
+//			} else {
+//				a = b;
+//			}
+//
+//			buf[index++] = HEX_CHAR[a / 16];
+//			buf[index++] = HEX_CHAR[a % 16];
+//		}
+//		return new String(buf);
+//	}
+//	/**
+//	 * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
+//	 *
+//	 * @param bytes 寰呰浆鎹yte[]
+//	 * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
+//	 */
+//	public static String bytesToHex_BE(byte[] bytes, int startIndex, int endIndex) {
+//		byte[] bs = new byte[endIndex - startIndex + 1] ;
+//		byte j = 0 ;
+//		for(int i = startIndex; i <= endIndex; i++){
+//			bs[j++] = bytes[i] ;
+//		}
+//		//涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
+//		char[] buf = new char[bs.length * 2];
+//		int a = 0;
+//		int index = 0;
+//		for (byte b : bs) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
+//			if (b < 0) {
+//				a = 256 + b;
+//			} else {
+//				a = b;
+//			}
+//
+//			buf[index++] = HEX_CHAR[a / 16];
+//			buf[index++] = HEX_CHAR[a % 16];
+//		}
+//		return new String(buf);
+//	}
+//
+//    /**
+//     * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
+//     *
+//     * @param bytes 寰呰浆鎹yte[]
+//     * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
+//     */
+//    public static String bytesToHex_LE(byte[] bytes, int startIndex, int endIndex) {
+//        byte[] bs = new byte[endIndex - startIndex + 1] ;
+//        byte j = 0 ;
+//        for(int i = endIndex; i >= startIndex; i--){
+//            bs[j++] = bytes[i] ;
+//        }
+//        //涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
+//        char[] buf = new char[bs.length * 2];
+//        int a = 0;
+//        int index = 0;
+//        for (byte b : bs) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
+//            if (b < 0) {
+//                a = 256 + b;
+//            } else {
+//                a = b;
+//            }
+//
+//            buf[index++] = HEX_CHAR[a / 16];
+//            buf[index++] = HEX_CHAR[a % 16];
+//        }
+//        return new String(buf);
+//    }
+//
+//	/**
+//	 * 灏�16杩涘埗瀛楃涓茶浆鎹负byte[]
+//	 *
+//	 * @param str 寰呰浆鎹㈠瓧绗︿覆
+//	 * @return 杩斿洖 杞崲鍚庣殑byte[]
+//	 */
+//	public static byte[] hexToBytes(String str) {
+//		if (str == null || "".equals(str.trim())) {
+//			return new byte[0];
+//		}
+//
+//		byte[] bytes = new byte[str.length() / 2];
+//		for (int i = 0; i < str.length() / 2; i++) {
+//			String subStr = str.substring(i * 2, i * 2 + 2);
+//			bytes[i] = (byte) Integer.parseInt(subStr, 16);
+//		}
+//
+//		return bytes;
+//	}
 
 	/**
 	 * Convert char to byte
 	 * @param c char
-	 * @return byte
+	 * @return 杩斿洖 byte
 	 */
 	private static byte charToByte(char c) {
 		return (byte) "0123456789ABCDEF".indexOf(c);
-	}	 
-	 
+	}
+
 
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 鏁村舰杞垚BCD缂栫爜
-	 * @param l
-	 * @return
+	 * @param i
+	 * @return 杩斿洖
 	 */
 	public static byte[] int2BCD_BE(int i)throws Exception {
 		String str = "" + i;
@@ -1079,8 +1193,8 @@
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 鏁村舰杞垚BCD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑
-	 * @param l
-	 * @return
+	 * @param i
+	 * @return 杩斿洖
 	 */
 	public static byte[] int2BCD_LE(int i)throws Exception {
 		String str = "" + i;
@@ -1096,10 +1210,35 @@
 	}
 
 	/**
+	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
+	 * 鏁村舰杞垚BCD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑
+	 * @param i
+	 * @param bs
+	 * @param from
+	 * @return 杩斿洖
+	 */
+	public static void int2BCD_LE(int i, byte[] bs, int from)throws Exception {
+		String str = "" + i;
+		byte[] b = null;
+		if (str.length() % 2 == 0) {
+			b = new byte[str.length() / 2];
+		} else {
+			b = new byte[(str.length() / 2) + 1];
+		}
+		encodeBCD_LE(str, b, 0, b.length);
+
+		int len = bs.length ;
+		int bLen = b.length ;
+		for(int j = 0; (j < len && j < bLen); j++){
+			bs[from + j] = b[j] ;
+		}
+	}
+
+	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 闀挎暣褰㈣浆鎴怋CD缂栫爜
 	 * @param l
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static byte[] long2BCD_BE(long l)throws Exception {
 		String str = "" + l;
@@ -1118,7 +1257,7 @@
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 闀挎暣褰㈣浆鎴怋CD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑
 	 * @param l
-	 * @return
+	 * @return 杩斿洖
 	 */
 	public static byte[] long2BCD_LE(long l) throws Exception {
 		String str = "" + l;
@@ -1137,30 +1276,30 @@
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 瀛楃涓插瀷鏁板瓧杞垚BCD缂栫爜
 	 * @param s
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static byte[] string2BCD_BE(String s) throws Exception {
-		byte[] b = null;
+		byte[] b ;
 		if (s.length() % 2 == 0) {
 			b = new byte[s.length() / 2];
 		} else {
 			b = new byte[(s.length() / 2) + 1];
 		}
-		
+
 		encodeBCD_BE(s, b, 0, b.length);
 
 		return b ;
 	}
-	
+
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 瀛楃涓茶浆鎹㈡垚byte鏁扮粍
 	 * @value bs byte[]
 	 * @value str String
 	 * @value fromIndex int
-	 * @return
-	 * @throws java.io.Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父 寮傚父
 	 */
 	public static int string2BCD_BE(byte[] bs, String str, int fromIndex)throws Exception {
 		byte[] bb = string2BCD_BE(str);
@@ -1179,8 +1318,8 @@
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * 瀛楃涓插瀷鏁板瓧杞垚BCD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑
 	 * @param s
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static byte[] string2BCD_LE(String s) throws Exception {
 		byte[] b = null;
@@ -1193,15 +1332,15 @@
 
 		return b;
 	}
-	
+
 	/**
-	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
+	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * 瀛楃涓茶浆鎹㈡垚byte鏁扮粍
 	 * @value bs byte[]
 	 * @value str String
 	 * @value fromIndex int
-	 * @return
-	 * @throws java.io.Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父 寮傚父
 	 */
 	public static int string2BCD_LE(byte[] bs, String str, int fromIndex)throws Exception {
 		byte[] bb = string2BCD_LE(str);
@@ -1221,10 +1360,8 @@
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
 	 * BCD缂栫爜杞垚鏁村瀷
 	 * @param b
-	 * @param startIndex
-	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static int BCD2Int_BE(byte b) throws Exception {
 		String str = "";
@@ -1237,10 +1374,8 @@
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
 	 * BCD缂栫爜杞垚鏁村瀷锛屽瓧鑺傞『搴忔槸鍊掔殑
 	 * @param b
-	 * @param startIndex
-	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static int BCD2Int_LE(byte b) throws Exception {
 		String str = "";
@@ -1255,8 +1390,8 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static int BCD2Int_BE(byte[] b, int startIndex, int endIndex)throws Exception {
 		String str = "";
@@ -1271,8 +1406,8 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static int BCD2Int_LE(byte[] b, int startIndex, int endIndex)throws Exception {
 		String str = "";
@@ -1287,8 +1422,8 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static long BCD2Long_BE(byte[] b, int startIndex, int endIndex)throws Exception {
 		String str = "";
@@ -1304,14 +1439,13 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static long BCD2Long_LE(byte[] b, int startIndex, int endIndex)throws Exception {
 		String str = "";
 		str = decodeBCD_LE(b, startIndex, endIndex - startIndex + 1);
-		long n = Long.parseLong(str);
-		return n;
+        return Long.parseLong(str);
 	}
 
 	/**
@@ -1320,8 +1454,8 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static String BCD2String_BE(byte[] b, int startIndex, int endIndex) throws Exception {
 		return decodeBCD_BE(b, startIndex, endIndex - startIndex + 1);
@@ -1333,8 +1467,8 @@
 	 * @param b
 	 * @param startIndex
 	 * @param endIndex
-	 * @return
-	 * @throws Exception
+	 * @return 杩斿洖
+	 * @throws Exception 寮傚父
 	 */
 	public static String BCD2String_LE(byte[] b, int startIndex, int endIndex) throws Exception {
 		return decodeBCD_LE(b, startIndex, endIndex - startIndex + 1);
@@ -1342,17 +1476,17 @@
 
 	/**
 	 * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘��
-	 * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴�  13  87锛岄『搴忔槸姝g殑 
+	 * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴�  13  87锛岄『搴忔槸姝g殑
 	 * @param value
 	 * @param dest
 	 * @param startIndex
-	 * @param length
+	 * @param length 闀垮害
 	 */
 	private static void encodeBCD_BE(String value, byte[] dest, int startIndex, int length)throws Exception {
 		if (value == null || !value.matches("\\d*")) {
 			throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + value, null);
 		}
-		
+
 		int[] tmpInts = new int[2 * length];
 		int index = value.length() - 1;
 		for (int i = tmpInts.length - 1; i >= 0 && index >= 0; i--, index--) {
@@ -1362,20 +1496,20 @@
 			dest[i] = (byte) (tmpInts[2 * j] * 16 + tmpInts[2 * j + 1]);
 		}
 	}
-	
+
 	/**
 	 * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘��
-	 * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴�  87  13锛岄『搴忔槸鍊掔殑 
+	 * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴�  87  13锛岄『搴忔槸鍊掔殑
 	 * @param value
 	 * @param dest
 	 * @param startIndex
-	 * @param length
+	 * @param length 闀垮害
 	 */
 	private static void encodeBCD_LE(String value, byte[] dest, int startIndex, int length)throws Exception {
 		if (value == null || !value.matches("\\d*")) {
 			throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + value, null);
 		}
-		
+
 		int[] tmpInts = new int[2 * length];
 		int index = value.length() - 1;
 		for (int i = 0; i <= tmpInts.length - 1 && index >= 0; i++, index--) {
@@ -1393,8 +1527,8 @@
 	 * 瑙g爜BCD锛岄『搴忔槸姝g殑
 	 * @param src
 	 * @param startIndex
-	 * @param length
-	 * @return
+	 * @param length 闀垮害
+	 * @return 杩斿洖
 	 */
 	private static String decodeBCD_BE(byte[] src, int startIndex, int length)throws Exception {
 		StringBuilder sb = new StringBuilder();
@@ -1415,8 +1549,8 @@
  	 * 缂栫爜BCD锛岄『搴忔槸鍊掔殑
 	 * @param src
 	 * @param startIndex
-	 * @param length
-	 * @return
+	 * @param length 闀垮害
+	 * @return 杩斿洖
 	 */
 	private static String decodeBCD_LE(byte[] src, int startIndex, int length)throws Exception {
 		StringBuilder sb = new StringBuilder();
@@ -1462,6 +1596,7 @@
 //		System.out.println(v5);
 //
 //	}
+	/*
 	public static void main(String[] args) throws Exception {
 		byte[] bs = new byte[]{0x38, 0x36, 0x39, 0x31} ; 
 		String s = bytes2String_BE(bs, 0, 3) ;
@@ -1475,5 +1610,6 @@
 		}
 		System.out.println(v);
 	}
-	
+	*/
+
 }

--
Gitblit v1.8.0