Java 字节数组分割
public static byte[] subByteArray(byte[] sourceByte, int startIndex) {
byte[] tmpByte = new byte[sourceByte.length - startIndex];
System.arraycopy(sourceByte, startIndex, tmpByte, 0, tmpByte.length);
return tmpByte;
}
public static byte[] subByteArray(byte[] sourceByte, int startIndex, int length) {
byte[] tmpByte = new byte[sourceByte.length - startIndex];
System.arraycopy(sourceByte, startIndex, tmpByte, 0, length);
return tmpByte;
}
public static byte[] subByteArray(byte[] sourceByte, int bufferLen, int startIndex, int length) {
byte[] tmpByte = new byte[bufferLen];
System.arraycopy(sourceByte, startIndex, tmpByte, 0, length);
return tmpByte;
}