当前位置: 首页>>代码示例>>Java>>正文


Java JMemoryPool类代码示例

本文整理汇总了Java中org.jnetpcap.nio.JMemoryPool的典型用法代码示例。如果您正苦于以下问题:Java JMemoryPool类的具体用法?Java JMemoryPool怎么用?Java JMemoryPool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JMemoryPool类属于org.jnetpcap.nio包,在下文中一共展示了JMemoryPool类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SlidingBuffer

import org.jnetpcap.nio.JMemoryPool; //导入依赖的package包/类
/**
 * Instantiates a new sliding buffer.
 * 
 * @param size
 *          the size
 */
public SlidingBuffer(int size) {
	this.size = size;

	/*
	 * Allocate round robin buffer with padding so that we can duplicate a few
	 * bytes at the right edge of the real offset. This way if we're asked to
	 * read a value that is wrapped around mid way at the end of the buffer, we
	 * can just safely read it since those bytes have been duplicated.
	 */
	this.storage = JMemoryPool.buffer(size + JNumber.Type.getBiggestSize());
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:18,代码来源:SlidingBuffer.java

示例2: getMemoryPool

import org.jnetpcap.nio.JMemoryPool; //导入依赖的package包/类
/**
 * Gets the current memory allocation memory pool.
 * 
 * @return current memory pool
 */
public static JMemoryPool getMemoryPool() {
	return pool;
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:9,代码来源:JPacket.java

示例3: setMemoryPool

import org.jnetpcap.nio.JMemoryPool; //导入依赖的package包/类
/**
 * Replaces the default memory allocation mechanism with user supplied one.
 * 
 * @param pool
 *            new memory pool to use.
 */
public static void setMemoryPool(JMemoryPool pool) {
	JPacket.pool = pool;
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:10,代码来源:JPacket.java

示例4: setMemoryPool

import org.jnetpcap.nio.JMemoryPool; //导入依赖的package包/类
/**
 * Replaces the default memory allocation mechanism with user supplied one.
 * 
 * @param pool
 *          new memory pool to use.
 */
public static void setMemoryPool(JMemoryPool pool) {
	JPacket.pool = pool;
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:10,代码来源:JPacket.java


注:本文中的org.jnetpcap.nio.JMemoryPool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。