io.vertx.core.buffer.Buffer.getMediumLE()方法的使用及代码示例

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

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

Buffer.getMediumLE介绍

[英]Gets a 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order.
[中]获取此缓冲区中指定绝对索引处的24位中间整数(以小尾数字节顺序)。

代码示例

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

private void testGetSetMedium(boolean isLE) throws Exception {
 int numInts = 100;
 Buffer b = Buffer.buffer(numInts * 3);
 for (int i = 0; i < numInts; i++) {
  if (isLE) {
   b.setMediumLE(i * 3, MEDIUM_MAX_VALUE + i);
  } else {
   b.setMedium(i * 3, MEDIUM_MAX_VALUE + i);
  }
 }
 for (int i = 0; i < numInts; i++) {
  if (isLE) {
   assertEquals((MEDIUM_MAX_VALUE + i - MEDIUM_MAX_VALUE), b.getMediumLE(i * 3));
  } else {
   assertEquals((MEDIUM_MAX_VALUE + i - MEDIUM_MAX_VALUE), b.getMedium(i * 3));
  }
 }
}

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Gets a 24-bit medium integer at the specified absolute <code>index</code> in this buffer in the Little Endian Byte Order.
 * @param pos 
 * @return 
 */
public int getMediumLE(int pos) { 
 int ret = delegate.getMediumLE(pos);
 return ret;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Gets a 24-bit medium integer at the specified absolute <code>index</code> in this buffer in the Little Endian Byte Order.
 * @param pos 
 * @return 
 */
public int getMediumLE(int pos) { 
 int ret = delegate.getMediumLE(pos);
 return ret;
}

代码示例来源:origin: io.vertx/vertx-core

private void testGetSetMedium(boolean isLE) throws Exception {
 int numInts = 100;
 Buffer b = Buffer.buffer(numInts * 3);
 for (int i = 0; i < numInts; i++) {
  if (isLE) {
   b.setMediumLE(i * 3, MEDIUM_MAX_VALUE + i);
  } else {
   b.setMedium(i * 3, MEDIUM_MAX_VALUE + i);
  }
 }
 for (int i = 0; i < numInts; i++) {
  if (isLE) {
   assertEquals((MEDIUM_MAX_VALUE + i - MEDIUM_MAX_VALUE), b.getMediumLE(i * 3));
  } else {
   assertEquals((MEDIUM_MAX_VALUE + i - MEDIUM_MAX_VALUE), b.getMedium(i * 3));
  }
 }
}

相关文章