io.netty.buffer.ByteBuf.setByte()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中io.netty.buffer.ByteBuf.setByte()方法的一些代码示例,展示了ByteBuf.setByte()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.setByte()方法的具体详情如下:
包路径:io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:setByte

ByteBuf.setByte介绍

[英]Sets the specified byte at the specified absolute index in this buffer. The 24 high-order bits of the specified value are ignored. This method does not modify readerIndex or writerIndex of this buffer.
[中]在此缓冲区中指定的绝对索引处设置指定的字节。指定值的24个高位将被忽略。此方法不修改此缓冲区的readerIndex或writerIndex。

代码示例

代码示例来源:origin: apache/incubator-dubbo

  1. @Override
  2. public void setByte(int index, int value) {
  3. buffer.setByte(index, value);
  4. }

代码示例来源:origin: netty/netty

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. buf.setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: netty/netty

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. buf.setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. buf.setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. buf.setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: netty/netty

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. unwrap().setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: netty/netty

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. unwrap().setByte(index, value);
  4. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. public Buffer setByte(int pos, byte b) {
  2. ensureWritable(pos, 1);
  3. buffer.setByte(pos, b);
  4. return this;
  5. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. public Buffer setUnsignedByte(int pos, short b) {
  2. ensureWritable(pos, 1);
  3. buffer.setByte(pos, b);
  4. return this;
  5. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. unwrap().setByte(index, value);
  4. return this;
  5. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. unwrap().setByte(index, value);
  4. }

代码示例来源:origin: netty/netty

  1. @Override
  2. public CompositeByteBuf setByte(int index, int value) {
  3. Component c = findComponent(index);
  4. c.buf.setByte(c.idx(index), value);
  5. return this;
  6. }

代码示例来源:origin: netty/netty

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. Component c = findComponent0(index);
  4. c.buf.setByte(c.idx(index), value);
  5. }

代码示例来源:origin: netty/netty

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. unwrap().setByte(idx(index), value);
  4. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. Component c = findComponent0(index);
  4. c.buf.setByte(c.idx(index), value);
  5. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public CompositeByteBuf setByte(int index, int value) {
  3. Component c = findComponent(index);
  4. c.buf.setByte(c.idx(index), value);
  5. return this;
  6. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. protected void _setByte(int index, int value) {
  3. unwrap().setByte(idx(index), value);
  4. }

代码示例来源:origin: netty/netty

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. checkIndex0(index, 1);
  4. unwrap().setByte(idx(index), value);
  5. return this;
  6. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public ByteBuf setByte(int index, int value) {
  3. checkIndex0(index, 1);
  4. unwrap().setByte(idx(index), value);
  5. return this;
  6. }

代码示例来源:origin: netty/netty

  1. private ChannelFuture finishEncode(final ChannelHandlerContext ctx, ChannelPromise promise) {
  2. if (finished) {
  3. promise.setSuccess();
  4. return promise;
  5. }
  6. finished = true;
  7. final ByteBuf footer = ctx.alloc().heapBuffer(
  8. compressor.maxCompressedLength(buffer.readableBytes()) + HEADER_LENGTH);
  9. flushBufferedData(footer);
  10. final int idx = footer.writerIndex();
  11. footer.setLong(idx, MAGIC_NUMBER);
  12. footer.setByte(idx + TOKEN_OFFSET, (byte) (BLOCK_TYPE_NON_COMPRESSED | compressionLevel));
  13. footer.setInt(idx + COMPRESSED_LENGTH_OFFSET, 0);
  14. footer.setInt(idx + DECOMPRESSED_LENGTH_OFFSET, 0);
  15. footer.setInt(idx + CHECKSUM_OFFSET, 0);
  16. footer.writerIndex(idx + HEADER_LENGTH);
  17. return ctx.writeAndFlush(footer, promise);
  18. }

相关文章

ByteBuf类方法