ByteHelper中getLenBytes错误解决

This commit is contained in:
zhaofeng233 committed 2021-03-13 23:18:52 +08:00
1 parent e622d92897
commit 8f75fad759
2 files changed
+13 -3

No files matched your search

+4 -2
View File
@@ -49,13 +49,15 @@ public class ByteHelper {
public static byte[] getLenBytes(byte[] buffer, VlInt start,VlInt len){
int startInt=start.getVlIntValue2Int();
int lenInt=len.getVlIntValue2Int();
byte[] lenbytes=new byte[1];
byte[] lenbytes=new byte[lenInt];
// byte[] lenbytes=new byte[1];
System.arraycopy(buffer,startInt,lenbytes,0,lenInt);
return lenbytes;
}
public static byte[] getLenBytes(byte[] buffer, VlInt start,int len){
int startInt=start.getVlIntValue2Int();
byte[] lenbytes=new byte[1];
byte[] lenbytes=new byte[len];
// byte[] lenbytes=new byte[1];
System.arraycopy(buffer,startInt,lenbytes,0,len);
return lenbytes;
}