⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flowdurdistmetric.java

📁 利用Java Socket写的一段通讯协议
💻 JAVA
字号:
package com.ict.netcom2.metric;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/**
 * 流持续时间分布
 * 28 bytes
 */
public class FlowDurDistMetric {
	
	public static final int length = 28;
	
	public int less10s; // 持续时间<=10s的流个数

	public int less30s; // 持续时间在10~30s之间的流个数

	public int less1m; // 持续时间在30s~1m之间的流个数

	public int less2m; // 持续时间在1~2m之间的流个数

	public int less5m; // 持续时间在2~5m之间的流个数

	public int less10m; // 持续时间在5~10m之间的流个数

	public int more10m; // 持续时间10~30m的流个数
	
	public void store(byte[] result) {
		
		if (result.length != length) {
			System.err.println("[FlowDurDistMetric.store()] param len wrong.");
		}
		
		ByteBuffer buf = ByteBuffer.wrap(result);
		buf.order(ByteOrder.LITTLE_ENDIAN);
		
		this.less10s = buf.getInt();
		this.less30s = buf.getInt();
		this.less1m = buf.getInt();
		this.less2m = buf.getInt();
		this.less5m = buf.getInt();
		this.less10m = buf.getInt();
		this.more10m = buf.getInt();
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -