org.littleshoot.mina.common.ByteBuffer.putShort()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(107)

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

ByteBuffer.putShort介绍

暂无

代码示例

代码示例来源:origin: org.littleshoot/mina-port

public ByteBuffer putShort(short value) {
  buf.putShort(value);
  return this;
}

代码示例来源:origin: org.littleshoot/mina-port

public ByteBuffer putShort(int index, short value) {
  buf.putShort(index, value);
  return this;
}

代码示例来源:origin: org.littleshoot/mina-util

/**
 * Puts an unsigned byte into the buffer.
 * 
 * @param bb The buffer.
 * @param position The index in the buffer to insert the value.
 * @param value The value to insert.
 */
public static void putUnsignedShort(final ByteBuffer bb, final int position, 
  final int value)
  {
  bb.putShort(position, (short) (value & 0xffff));
  }

代码示例来源:origin: org.littleshoot/mina-util

/**
 * Puts an unsigned byte into the buffer.
 * 
 * @param bb The buffer.
 * @param value The value to insert.
 */
public static void putUnsignedShort(final ByteBuffer bb, final int value)
  {
  bb.putShort((short) (value & 0xffff));
  }

代码示例来源:origin: org.littleshoot/mina-port

break;
  case 2:
    putShort((short) 0);
    break;
  case 4:
  break;
case 2:
  putShort(oldPos - 2, (short) length);
  break;
case 4:

代码示例来源:origin: org.littleshoot/mina-port

/**
 * Fills this buffer with <code>NUL (0x00)</code>.
 * This method moves buffer position forward.
 */
public ByteBuffer fill(int size) {
  autoExpand(size);
  int q = size >>> 3;
  int r = size & 7;
  for (int i = q; i > 0; i--) {
    putLong(0L);
  }
  q = r >>> 2;
  r = r & 3;
  if (q > 0) {
    putInt(0);
  }
  q = r >> 1;
  r = r & 1;
  if (q > 0) {
    putShort((short) 0);
  }
  if (r > 0) {
    put((byte) 0);
  }
  return this;
}

代码示例来源:origin: org.littleshoot/mina-port

putShort(shortValue);

相关文章