本文整理了Java中org.glassfish.grizzly.Buffer.order()
方法的一些代码示例,展示了Buffer.order()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.order()
方法的具体详情如下:
包路径:org.glassfish.grizzly.Buffer
类名称:Buffer
方法名:order
[英]Retrieves this buffer's byte order.
The byte order is used when reading or writing multibyte values, and when creating buffers that are views of this Buffer
. The order of a newly-created Buffer
is always ByteOrder#BIG_ENDIAN.
[中]检索此缓冲区的字节顺序。
读取或写入多字节值以及创建作为此Buffer
视图的缓冲区时,使用字节顺序。新创建的Buffer
的顺序始终是字节顺序#BIG#u ENDIAN。
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-core
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-framework
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-framework
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
private void refreshBuffers() {
int currentCapacity = 0;
for(int i = 0; i < buffersSize; i++) {
final Buffer buffer = buffers[i];
currentCapacity += buffer.remaining();
bufferBounds[i] = currentCapacity;
buffer.order(byteOrder);
}
capacity = currentCapacity;
}
代码示例来源:origin: javaee/grizzly
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: javaee/grizzly
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-core
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: javaee/grizzly
@Override
public BuffersBuffer order(final ByteOrder bo) {
checkDispose();
if (bo != byteOrder) {
this.byteOrder = bo;
this.bigEndian = (bo == ByteOrder.BIG_ENDIAN);
// propagate ByteOrder to underlying Buffers
for (int i = 0; i < buffersSize; i++) {
buffers[i].order(bo);
}
}
return this;
}
代码示例来源:origin: javaee/grizzly
@Test
public void testByteOrderRestored() {
Buffer b = mm.allocate(1024);
if (b instanceof HeapBuffer) {
b.order(ByteOrder.LITTLE_ENDIAN);
assertEquals(ByteOrder.LITTLE_ENDIAN, b.order());
b.dispose();
assertEquals(ByteOrder.BIG_ENDIAN, b.order());
}
}
内容来源于网络,如有侵权,请联系作者删除!