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

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

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

ByteBuf.setMediumLE介绍

[英]Sets the specified 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order. Please note that the most significant byte is ignored in the specified value. This method does not modify readerIndex or writerIndex of this buffer.
[中]在该缓冲区中指定的绝对索引处,以小尾端字节顺序设置指定的24位中间整数。请注意,指定值中的最高有效字节被忽略。此方法不修改此缓冲区的readerIndex或writerIndex。

代码示例

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  buf.setMediumLE(index, value);
  return this;
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  buf.setMediumLE(index, value);
  return this;
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  buf.setMediumLE(index, value);
  return this;
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  unwrap().setMediumLE(index, value);
  return this;
}

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

private static void setChunkLength(ByteBuf out, int lengthIdx) {
  int chunkLength = out.writerIndex() - lengthIdx - 3;
  if (chunkLength >>> 24 != 0) {
    throw new CompressionException("compressed data too large: " + chunkLength);
  }
  out.setMediumLE(lengthIdx, chunkLength);
}

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

@Override
protected void _setMediumLE(int index, int value) {
  unwrap().setMediumLE(index, value);
}

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

public Buffer setMediumLE(int pos, int i) {
 ensureWritable(pos, 3);
 buffer.setMediumLE(pos, i);
 return this;
}

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

private static void setChunkLength(ByteBuf out, int lengthIdx) {
  int chunkLength = out.writerIndex() - lengthIdx - 3;
  if (chunkLength >>> 24 != 0) {
    throw new CompressionException("compressed data too large: " + chunkLength);
  }
  out.setMediumLE(lengthIdx, chunkLength);
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  unwrap().setMediumLE(index, value);
  return this;
}

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

@Override
protected void _setMediumLE(int index, int value) {
  unwrap().setMediumLE(index, value);
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  unwrap().setMediumLE(index, value);
  return this;
}

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

private static void setChunkLength(ByteBuf out, int lengthIdx) {
  int chunkLength = out.writerIndex() - lengthIdx - 3;
  if (chunkLength >>> 24 != 0) {
    throw new CompressionException("compressed data too large: " + chunkLength);
  }
  out.setMediumLE(lengthIdx, chunkLength);
}

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

@Override
protected void _setMediumLE(int index, int value) {
  unwrap().setMediumLE(idx(index), value);
}

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

@Override
protected void _setMediumLE(int index, int value) {
  unwrap().setMediumLE(idx(index), value);
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  checkIndex0(index, 3);
  unwrap().setMediumLE(idx(index), value);
  return this;
}

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

@Override
protected void _setMediumLE(int index, int value) {
  unwrap().setMediumLE(idx(index), value);
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  checkIndex0(index, 3);
  unwrap().setMediumLE(idx(index), value);
  return this;
}

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

@Override
public ByteBuf setMediumLE(int index, int value) {
  checkIndex0(index, 3);
  unwrap().setMediumLE(idx(index), value);
  return this;
}

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

@Override
protected void _setMediumLE(int index, int value) {
  Component c = findComponent0(index);
  if (index + 3 <= c.endOffset) {
    c.buf.setMediumLE(c.idx(index), value);
  } else if (order() == ByteOrder.BIG_ENDIAN) {
    _setShortLE(index, (short) value);
    _setByte(index + 2, (byte) (value >>> 16));
  } else {
    _setShortLE(index, (short) (value >> 8));
    _setByte(index + 2, (byte) value);
  }
}

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

@Override
protected void _setMediumLE(int index, int value) {
  Component c = findComponent0(index);
  if (index + 3 <= c.endOffset) {
    c.buf.setMediumLE(c.idx(index), value);
  } else if (order() == ByteOrder.BIG_ENDIAN) {
    _setShortLE(index, (short) value);
    _setByte(index + 2, (byte) (value >>> 16));
  } else {
    _setShortLE(index, (short) (value >> 8));
    _setByte(index + 2, (byte) value);
  }
}

相关文章

ByteBuf类方法