com.couchbase.client.deps.io.netty.buffer.ByteBuf.getChar()方法的使用及代码示例

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

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

ByteBuf.getChar介绍

[英]Gets a 2-byte UTF-16 character at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
[中]获取此缓冲区中指定绝对索引处的2字节UTF-16字符。此方法不修改此缓冲区的readerIndex或writerIndex。

代码示例

代码示例来源:origin: com.couchbase.client/core-io

@Override
public char getChar(int index) {
  return buf.getChar(index);
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public char getChar(int index) {
  return buf.getChar(index);
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public char getChar(int index) {
  checkIndex(index, 2);
  return buffer.getChar(index);
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public char getChar(int index) {
  checkIndex(index, 2);
  return buffer.getChar(index);
}

代码示例来源:origin: com.couchbase.client/java-client

@Override
protected JsonBooleanDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags, ResponseStatus status)
  throws Exception {
  boolean decoded;
  if (TranscoderUtils.hasCommonFlags(flags) && flags == TranscoderUtils.JSON_COMMON_FLAGS) {
    String val = content.toString(CharsetUtil.UTF_8);
    decoded = val.equals("true");
  } else if (flags == 1 << 8) {
    char val = content.getChar(0);
    decoded = val == '1';
  } else {
    throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non " +
      "JsonBooleanDocument id " + id + ", could not decode.");
  }
  return newDocument(id, expiry, decoded, cas);
}

相关文章