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

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

本文整理了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

  1. @Override
  2. public char getChar(int index) {
  3. return buf.getChar(index);
  4. }

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

  1. @Override
  2. public char getChar(int index) {
  3. return buf.getChar(index);
  4. }

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

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

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

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

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

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

相关文章