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

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

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

ByteBuf.alloc介绍

[英]Returns the ByteBufAllocator which created this buffer.
[中]返回创建此缓冲区的ByteBufAllocator。

代码示例

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return buf.alloc();
  4. }

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

  1. @Override
  2. public final ByteBufAllocator alloc() {
  3. return buf.alloc();
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return buffer.alloc();
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return buffer.alloc();
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return buf.alloc();
  4. }

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

  1. @Override
  2. public final ByteBufAllocator alloc() {
  3. return buf.alloc();
  4. }

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

  1. public static ByteBuf encode(
  2. ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) {
  3. return encode(src, off, len, breakLines, dialect, src.alloc());
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. public static ByteBuf decode(
  2. ByteBuf src, int off, int len, Base64Dialect dialect) {
  3. return decode(src, off, len, dialect, src.alloc());
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. public static ByteBuf decode(
  2. ByteBuf src, int off, int len, Base64Dialect dialect) {
  3. return decode(src, off, len, dialect, src.alloc());
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. public static ByteBuf encode(
  2. ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) {
  3. return encode(src, off, len, breakLines, dialect, src.alloc());
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. @Override
  2. public ByteBufAllocator alloc() {
  3. return unwrap().alloc();
  4. }

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

  1. public static byte[] getContentAsByteArray(ByteBuf buffer) {
  2. final ByteBuf content = getContent(buffer);
  3. if (isSnappyCompressed(buffer)) {
  4. // Avoid a memory copy by stealing the decompressed buffer's backing array.
  5. if (!(content.alloc() instanceof UnpooledByteBufAllocator)) {
  6. throw new RuntimeException("Expected decompressed content buffer to be unpooled.");
  7. }
  8. if (content.array().length != content.readableBytes()) {
  9. throw new RuntimeException("Expected decompressed content buffer to be backed by array of exact size.");
  10. }
  11. return content.array();
  12. }
  13. byte[] bytes = new byte[content.readableBytes()];
  14. content.getBytes(0, bytes);
  15. return bytes;
  16. }

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

  1. decoder.decode(buf.nioBuffer(index, length));
  2. } else {
  3. ByteBuf heapBuffer = buf.alloc().heapBuffer(length);
  4. try {
  5. heapBuffer.writeBytes(buf, index, length);

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

  1. ByteBuf buffer = src.alloc().heapBuffer(len);
  2. try {
  3. buffer.writeBytes(src, readerIndex, len);

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

  1. ByteBuf buffer = src.alloc().heapBuffer(len);
  2. try {
  3. buffer.writeBytes(src, readerIndex, len);

相关文章