@Override public String toString(Charset charset) { return toString(readerIndex, readableBytes(), charset); }
@Override public void write(DrillBuf buf, OutputStream out) throws IOException { assert(buf.readerIndex() == 0); write(buf, buf.readableBytes(), out); }
@Override public ByteBuf slice() { return slice(readerIndex(), readableBytes()); }
@Override public ByteBuffer nioBuffer() { return nioBuffer(readerIndex(), readableBytes()); }
assertEquals(256, drillBuf.capacity()); assertEquals(0, drillBuf.readerIndex()); assertEquals(0, drillBuf.readableBytes()); assertEquals(0, drillBuf.writerIndex()); assertEquals(256, drillBuf.writableBytes()); assertEquals(0, slice3.readableBytes()); assertEquals(0, slice3.writerIndex()); assertEquals(256, drillBuf.readableBytes()); assertEquals(256, drillBuf.writerIndex()); assertEquals(0, drillBuf.writableBytes()); assertEquals(256, slice1.readableBytes()); for(int i = 0; i < 10; ++i) { assertEquals(i, slice1.readByte()); assertEquals(256 - 10, slice1.readableBytes()); for(int i = 0; i < 256; ++i) { assertEquals((byte) i, slice1.getByte(i)); assertEquals(25, slice2.readableBytes()); for(int i = 25; i < 50; ++i) { assertEquals(i, slice2.readByte());
public long getByteCount() { return body == null ? 0 : body.readableBytes(); }
@Override public String toString(Charset charset) { return toString(readerIndex, readableBytes(), charset); }
public long getBodySize() { if (batch.getBody() == null) { return 0; } assert batch.getBody().readableBytes() >= 0; return batch.getBody().readableBytes(); }
@Override public void eval() { buffer.clear(); org.apache.drill.exec.util.ByteBufUtil.HadoopWritables.writeVLong(buffer, 0, 9, in.value); out.buffer = buffer; out.start = 0; out.end = buffer.readableBytes(); } }
@Override public void eval() { buffer.clear(); org.apache.drill.exec.util.ByteBufUtil.HadoopWritables.writeVLong(buffer, 0, 9, in.value); out.buffer = buffer; out.start = 0; out.end = buffer.readableBytes(); } }
@Override public void write(DrillBuf buf, OutputStream out) throws IOException { assert(buf.readerIndex() == 0); write(buf, buf.readableBytes(), out); }
@Override public ByteBuffer nioBuffer() { return nioBuffer(readerIndex(), readableBytes()); }
@Override public ByteBuf slice() { return slice(readerIndex(), readableBytes()); }
public RuntimeFilterWritable duplicate(BufferAllocator bufferAllocator) { int len = data.length; DrillBuf[] cloned = new DrillBuf[len]; int i = 0; for (DrillBuf src : data) { int capacity = src.readableBytes(); DrillBuf duplicateOne = bufferAllocator.buffer(capacity); int readerIndex = src.readerIndex(); duplicateOne.writeBytes(src); src.readerIndex(readerIndex); cloned[i] = duplicateOne; i++; } return new RuntimeFilterWritable(runtimeFilterBDef, cloned); }