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

📄 flowpktdistmetric.java

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

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

/**
 * 流大小分布统计,按照包个数 
 * 32 bytes
 */
public class FlowPktDistMetric {

	public static final int length = 32;

	public int less10; // 包个数<=10的流个数

	public int less50; // 包个数在10~50之间的流个数

	public int less100; // 包个数在50~100之间的流个数

	public int less200; // 包个数在100~200之间的流个数

	public int less400; // 包个数在200~400之间的流个数

	public int less600; // 包个数在400~600之间的流个数

	public int less1000; // 包个数在600~1000之间的流个数

	public int more1000; // 包个数>1000的流个数

	public void store(byte[] result) {
		
		if (result.length != length) {
			System.err.println("[FlowPktDistMetric.store()] param len wrong.");
		}
		
		ByteBuffer buf = ByteBuffer.wrap(result);
		buf.order(ByteOrder.LITTLE_ENDIAN);
		
		this.less10 = buf.getInt();
		this.less50 = buf.getInt();
		this.less100 = buf.getInt();
		this.less200 = buf.getInt();
		this.less400 = buf.getInt();
		this.less600 = buf.getInt();
		this.less1000 = buf.getInt();
		this.more1000 = buf.getInt();
	}

}

⌨️ 快捷键说明

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