本文整理了Java中org.glassfish.grizzly.memory.Buffers.slice()
方法的一些代码示例,展示了Buffers.slice()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffers.slice()
方法的具体详情如下:
包路径:org.glassfish.grizzly.memory.Buffers
类名称:Buffers
方法名:slice
[英]Slice ByteBuffer of required size from big chunk. Passed chunk position will be changed, after the slicing (chunk.position += size).
[中]从大块中按所需大小切片ByteBuffer。切片后,传递的区块位置将发生更改(chunk.position+=size)。
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-core
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-framework
@Override
public ByteBuffer allocate(int size) {
final ByteBuffer allocated = Buffers.slice(pool, size);
return addHistory(allocated);
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-framework
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
代码示例来源:origin: javaee/grizzly
@Override
public ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize) {
if (isLastAllocated(oldByteBuffer)
&& remaining() + oldByteBuffer.capacity() >= newSize) {
lastAllocatedIndex--;
pool.position(pool.position() - oldByteBuffer.capacity());
final ByteBuffer newByteBuffer = Buffers.slice(pool, newSize);
newByteBuffer.position(oldByteBuffer.position());
return addHistory(newByteBuffer);
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!