@Override public ByteBufAllocator alloc() { return buf.alloc(); }
@Override public final ByteBufAllocator alloc() { return buf.alloc(); }
@Override public ByteBufAllocator alloc() { return buffer.alloc(); }
@Override public ByteBufAllocator alloc() { return buffer.alloc(); }
@Override public ByteBufAllocator alloc() { return buf.alloc(); }
@Override public final ByteBufAllocator alloc() { return buf.alloc(); }
public static ByteBuf encode( ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) { return encode(src, off, len, breakLines, dialect, src.alloc()); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
public static ByteBuf decode( ByteBuf src, int off, int len, Base64Dialect dialect) { return decode(src, off, len, dialect, src.alloc()); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
public static ByteBuf decode( ByteBuf src, int off, int len, Base64Dialect dialect) { return decode(src, off, len, dialect, src.alloc()); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
public static ByteBuf encode( ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) { return encode(src, off, len, breakLines, dialect, src.alloc()); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
@Override public ByteBufAllocator alloc() { return unwrap().alloc(); }
public static byte[] getContentAsByteArray(ByteBuf buffer) { final ByteBuf content = getContent(buffer); if (isSnappyCompressed(buffer)) { // Avoid a memory copy by stealing the decompressed buffer's backing array. if (!(content.alloc() instanceof UnpooledByteBufAllocator)) { throw new RuntimeException("Expected decompressed content buffer to be unpooled."); } if (content.array().length != content.readableBytes()) { throw new RuntimeException("Expected decompressed content buffer to be backed by array of exact size."); } return content.array(); } byte[] bytes = new byte[content.readableBytes()]; content.getBytes(0, bytes); return bytes; }
decoder.decode(buf.nioBuffer(index, length)); } else { ByteBuf heapBuffer = buf.alloc().heapBuffer(length); try { heapBuffer.writeBytes(buf, index, length);
ByteBuf buffer = src.alloc().heapBuffer(len); try { buffer.writeBytes(src, readerIndex, len);
ByteBuf buffer = src.alloc().heapBuffer(len); try { buffer.writeBytes(src, readerIndex, len);