优化代码,性能暴涨

This commit is contained in:
Administrator
2025-01-29 14:01:11 +08:00
parent e243203535
commit 6de65562be
130 changed files with 9138 additions and 1020 deletions
@@ -0,0 +1,41 @@
package org.kne.cloud.network.srv6;
import java.nio.ByteBuffer;
import java.util.Arrays;
public class SRv6TLV {
public static final int PAD1=0;
public static final int PADN=4;
public static final int HMAC=5;
public static final int SEQS=7;
private int type;
private int length;
private byte[]value;
public SRv6TLV(int type, int length, byte[] value) {
super();
this.type = type;
this.length = length;
this.value = value;
}
@Override
public String toString() {
return "SRv6TLV [type=" + type + ", length=" + length + ", value=" + Arrays.toString(value) + "]";
}
public int getType() {
return type;
}
public int getLength() {
return length;
}
public byte[] getValue() {
return value;
}
public int getTotalLength() {
if(type==PAD1) {
return 1;
}
return 2+length;
}
}