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

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

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

ByteBuf.order介绍

[英]Returns the endianness of this buffer.
[中]返回此缓冲区的endianness

代码示例

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

@Override
public final ByteOrder order() {
  return buf.order();
}

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

public SwappedByteBuf(ByteBuf buf) {
  if (buf == null) {
    throw new NullPointerException("buf");
  }
  this.buf = buf;
  if (buf.order() == ByteOrder.BIG_ENDIAN) {
    order = ByteOrder.LITTLE_ENDIAN;
  } else {
    order = ByteOrder.BIG_ENDIAN;
  }
}

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

@Override
@Deprecated
public ByteOrder order() {
  return unwrap().order();
}

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

@Override
public ByteBuf retainedDuplicate() {
  return buf.retainedDuplicate().order(order);
}

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

@Override
@Deprecated
public ByteOrder order() {
  return unwrap().order();
}

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

@Override
@Deprecated
public ByteOrder order() {
  return unwrap().order();
}

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

/**
 * Writes a big-endian 16-bit short integer to the buffer.
 */
@SuppressWarnings("deprecation")
public static ByteBuf writeShortBE(ByteBuf buf, int shortValue) {
  return buf.order() == ByteOrder.BIG_ENDIAN? buf.writeShort(shortValue) : buf.writeShortLE(shortValue);
}

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

@Override
public ByteBuf copy() {
  return buf.copy().order(order);
}

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

@Override
public ByteBuf copy(int index, int length) {
  return buf.copy(index, length).order(order);
}

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

@Override
public ByteBuf readSlice(int length) {
  return buf.readSlice(length).order(order);
}

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

@Override
public ByteBuf slice(int index, int length) {
  return buf.slice(index, length).order(order);
}

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

@Override
public ByteBuf retainedSlice(int index, int length) {
  return buf.retainedSlice(index, length).order(order);
}

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

@Override
public ByteBuf duplicate() {
  return buf.duplicate().order(order);
}

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

@Override
public ByteBuf readBytes(int length) {
  return buf.readBytes(length).order(order());
}

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

@Override
public ByteBuf readRetainedSlice(int length) {
  return buf.readRetainedSlice(length).order(order);
}

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

@Override
public ByteBuf retainedSlice() {
  return buf.retainedSlice().order(order);
}

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

@Override
public ByteBuf slice() {
  return buf.slice().order(order);
}

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

ByteBuf decode(ByteBuf src, int off, int len, ByteBufAllocator allocator, Base64Dialect dialect) {
  dest = allocator.buffer(decodedBufferSize(len)).order(src.order()); // Upper limit on size of output
  decodabet = decodabet(dialect);
  try {
    src.forEachByte(off, len, this);
    return dest.slice(0, outBuffPosn);
  } catch (Throwable cause) {
    dest.release();
    PlatformDependent.throwException(cause);
    return null;
  }
}

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

/**
 * Sets a big-endian 16-bit short integer to the buffer.
 */
@SuppressWarnings("deprecation")
public static ByteBuf setShortBE(ByteBuf buf, int index, int shortValue) {
  return buf.order() == ByteOrder.BIG_ENDIAN? buf.setShort(index, shortValue) : buf.setShortLE(index, shortValue);
}

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

/**
 * Writes a big-endian 24-bit medium integer to the buffer.
 */
@SuppressWarnings("deprecation")
public static ByteBuf writeMediumBE(ByteBuf buf, int mediumValue) {
  return buf.order() == ByteOrder.BIG_ENDIAN? buf.writeMedium(mediumValue) : buf.writeMediumLE(mediumValue);
}

相关文章

ByteBuf类方法