本文整理了Java中org.glassfish.grizzly.Buffer.putInt()
方法的一些代码示例,展示了Buffer.putInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.putInt()
方法的具体详情如下:
包路径:org.glassfish.grizzly.Buffer
类名称:Buffer
方法名:putInt
[英]Relative put method for writing an int value (optional operation).
Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by four.
[中]用于写入int值的相对put方法(可选操作)。
按当前字节顺序将包含给定int值的四个字节写入当前位置的缓冲区,然后将该位置递增四。
代码示例来源:origin: org.glassfish.shoal/shoal-gms-impl
@Override
public Buffer putInt(final int index, final int value) {
grizzlyBuffer.putInt(index, value);
return this;
}
代码示例来源:origin: org.glassfish.shoal/shoal-gms-impl
@Override
public Buffer putInt(final int value) {
grizzlyBuffer.putInt(value);
return this;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
protected void serializeFrameHeader(final Buffer buffer) {
assert buffer.remaining() >= Http2Frame.FRAME_HEADER_SIZE;
buffer.putInt(
((getLength() & 0xffffff) << 8) |
getType());
buffer.put((byte) getFlags());
buffer.putInt(getStreamId());
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
protected void serializeFrameHeader(final Buffer buffer) {
assert buffer.remaining() >= Http2Frame.FRAME_HEADER_SIZE;
buffer.putInt(
((getLength() & 0xffffff) << 8) |
getType());
buffer.put((byte) getFlags());
buffer.putInt(getStreamId());
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http2
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(windowSizeIncrement & 0x7fffffff);
buffer.trim();
return buffer;
}
代码示例来源:origin: javaee/grizzly
protected void serializeFrameHeader(final Buffer buffer) {
assert buffer.remaining() >= Http2Frame.FRAME_HEADER_SIZE;
buffer.putInt(
((getLength() & 0xffffff) << 8) |
getType());
buffer.put((byte) getFlags());
buffer.putInt(getStreamId());
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(windowSizeIncrement & 0x7fffffff);
buffer.trim();
return buffer;
}
代码示例来源:origin: javaee/grizzly
protected void serializeFrameHeader(final Buffer buffer) {
assert buffer.remaining() >= Http2Frame.FRAME_HEADER_SIZE;
buffer.putInt(
((getLength() & 0xffffff) << 8) |
getType());
buffer.put((byte) getFlags());
buffer.putInt(getStreamId());
}
代码示例来源:origin: javaee/grizzly
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(windowSizeIncrement & 0x7fffffff);
buffer.trim();
return buffer;
}
代码示例来源:origin: javaee/grizzly
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 5);
serializeFrameHeader(buffer);
buffer.putInt((isExclusive ? 0x80000000 : 0) |
(streamDependency & 0x7fffffff));
buffer.put((byte) weight);
buffer.trim();
return buffer;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(errorCode.getCode());
buffer.trim();
return buffer;
}
代码示例来源:origin: javaee/grizzly
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(errorCode.getCode());
buffer.trim();
return buffer;
}
代码示例来源:origin: javaee/grizzly
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(errorCode.getCode());
buffer.trim();
return buffer;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 5);
serializeFrameHeader(buffer);
buffer.putInt((isExclusive ? 0x80000000 : 0) |
(streamDependency & 0x7fffffff));
buffer.put((byte) weight);
buffer.trim();
return buffer;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(errorCode.getCode());
buffer.trim();
return buffer;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http2
@Override
public Buffer toBuffer(final MemoryManager memoryManager) {
final Buffer buffer = memoryManager.allocate(FRAME_HEADER_SIZE + 4);
serializeFrameHeader(buffer);
buffer.putInt(errorCode.getCode());
buffer.trim();
return buffer;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public void writeInt(final int data) throws IOException {
if (isOutputBuffered) {
output.ensureBufferCapacity(4);
output.getBuffer().putInt(data);
} else {
output.write((byte) ((data >>> 24) & 0xFF));
output.write((byte) ((data >>> 16) & 0xFF));
output.write((byte) ((data >>> 8) & 0xFF));
output.write((byte) ((data) & 0xFF));
}
}
代码示例来源:origin: javaee/grizzly
@Override
public void writeInt(final int data) throws IOException {
if (isOutputBuffered) {
output.ensureBufferCapacity(4);
output.getBuffer().putInt(data);
} else {
output.write((byte) ((data >>> 24) & 0xFF));
output.write((byte) ((data >>> 16) & 0xFF));
output.write((byte) ((data >>> 8) & 0xFF));
output.write((byte) ((data) & 0xFF));
}
}
代码示例来源:origin: javaee/grizzly
@Override
public void writeInt(final int data) throws IOException {
if (isOutputBuffered) {
output.ensureBufferCapacity(4);
output.getBuffer().putInt(data);
} else {
output.write((byte) ((data >>> 24) & 0xFF));
output.write((byte) ((data >>> 16) & 0xFF));
output.write((byte) ((data >>> 8) & 0xFF));
output.write((byte) ((data) & 0xFF));
}
}
代码示例来源:origin: javaee/grizzly
@Override
public void writeInt(final int data) throws IOException {
if (isOutputBuffered) {
output.ensureBufferCapacity(4);
output.getBuffer().putInt(data);
} else {
output.write((byte) ((data >>> 24) & 0xFF));
output.write((byte) ((data >>> 16) & 0xFF));
output.write((byte) ((data >>> 8) & 0xFF));
output.write((byte) ((data) & 0xFF));
}
}
内容来源于网络,如有侵权,请联系作者删除!