Examples of capacity()


Examples of com.taobao.gecko.core.buffer.IoBuffer.capacity()

        IoBuffer buf = IoBuffer.wrap("put test 1 5 0 10\r\nhel".getBytes());

        PutCommand decodedCmd = (PutCommand) this.decoder.decode(buf, null);
        assertNull(decodedCmd);
        assertEquals(0, buf.position());
        assertEquals(buf.capacity(), buf.remaining());

        buf = IoBuffer.wrap("put test 1 5 0 10\r\nhello".getBytes());
        decodedCmd = (PutCommand) this.decoder.decode(buf, null);
        assertNotNull(decodedCmd);
        assertEquals("test", decodedCmd.getTopic());
View Full Code Here

Examples of freenet.node.stats.DataStoreStats.capacity()

     
      row = storeSizeTable.addChild("tr");
      row.addChild("th", l10n(instance.store.name()) + "\n" + " (" + l10n(instance.key.name()) + ")");

      row.addChild("td", thousandPoint.format(stats.keys()));
      row.addChild("td", thousandPoint.format(stats.capacity()));
      row.addChild("td", SizeUtil.formatSize(stats.dataSize()));
      row.addChild("td", fix3p1pct.format(stats.utilization()));
      row.addChild("td", thousandPoint.format(sessionAccess.readRequests()) +
          (totalAccess == null ? "" : (" ("+thousandPoint.format(totalAccess.readRequests())+")")));
      row.addChild("td", thousandPoint.format(sessionAccess.successfulReads()) +
View Full Code Here

Examples of gnu.trove.map.hash.THashMap.capacity()

    public void testTPHashMapConstructors() {

        int cap = 20;

        THashMap cap_and_factor = new THashMap( cap, 0.75f );
        assertTrue( "capacity not sufficient: " + cap + ", " + cap_and_factor.capacity(),
                cap <= cap_and_factor.capacity() );
        assertEquals( 0.75f, cap_and_factor._loadFactor );
    }

View Full Code Here

Examples of io.netty.buffer.ByteBuf.capacity()

    @Override
    public ByteTransferBuffer next() {
      try {
        ByteBuf byteBuf = PooledByteBufAllocator.DEFAULT.buffer(FSDelegation.this.buffer);
        if (this.set(byteBuf.writeBytes(this.input, byteBuf.capacity())).get() > 0) {
          this.readable.addAndGet(current.get());
        }
        this.queue.add(this.byteBuf = byteBuf);
        FSDelegation.this.resourceCounter.increment(FSDelegation.this.chunk);
        return this;
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.capacity()

                        }

                        if (result.bytesProduced() > 0) {
                            outNetBuf.flip();
                            msg = ChannelBuffers.buffer(outNetBuf.remaining());
                            msg.writeBytes(outNetBuf.array(), 0, msg.capacity());
                            outNetBuf.clear();

                            if (pendingWrite.outAppBuf.hasRemaining()) {
                                // pendingWrite's future shouldn't be notified if
                                // only partial data is written.
View Full Code Here

Examples of io.netty.buffer.CompositeByteBuf.capacity()

    ByteBuf buf;
    while ((buf = (ByteBuf) ch.readOutbound()) != null) {
      encodedEnvelopes.addComponent(buf);
    }

    return encodedEnvelopes.writerIndex(encodedEnvelopes.capacity());
  }

  private static void decodeAndVerify(EmbeddedChannel ch, ByteBuf buf, Envelope... expectedEnvelopes) {
    ch.writeInbound(buf);
View Full Code Here

Examples of io.netty.buffer.UnsafeDirectLittleEndian.capacity()

        return null;
      };

      UnsafeDirectLittleEndian buffer = innerAllocator.directBuffer(size, max);
      DrillBuf wrapped = new DrillBuf(this, childAcct, buffer);
      childAcct.reserved(buffer.capacity(), wrapped);
      return wrapped;
    }

    public DrillBuf buffer(int size) {
      return buffer(size, size);
View Full Code Here

Examples of java.nio.Buffer.capacity()

        final Image ardorImage = new Image();
        final TYPE bufferDataType = getBufferDataType(textureDataBuffer);
        if (bufferDataType == null) {
            throw new UnsupportedOperationException("Unknown buffer type " + textureDataBuffer.getClass().getName());
        } else {
            final int dataSizeInBytes = textureDataBuffer.capacity() * Buffers.sizeOfBufferElem(textureDataBuffer);
            final ByteBuffer scratch = createOnHeap ? BufferUtils.createByteBufferOnHeap(dataSizeInBytes) : Buffers
                    .newDirectByteBuffer(dataSizeInBytes);
            if (flipped) {
                flipImageData(textureDataBuffer, scratch, dataSizeInBytes, bufferDataType, textureData.getWidth(),
                        textureData.getHeight());
View Full Code Here

Examples of java.nio.ByteBuffer.capacity()

    if (o instanceof DynamicByteBuffer) {
      attachment = ((DynamicByteBuffer)o).getByteBuffer();
    } else {
      attachment = (ByteBuffer) o;
    }
    if (attachment.capacity() < READ_BUFFER_SIZE) {
      attachment = ByteBuffer.allocate(READ_BUFFER_SIZE);
    }
    attachment.clear()// prepare for reuse
    return attachment;
  }
View Full Code Here

Examples of java.nio.ByteBuffer.capacity()

     * change if r1 < position < r2 and if r1.length != r2.length, otherwise the
     * position should still end up on same record's start position
     */
    this.seek(p);

    this.autoflush.autoflushChange(b1.capacity() + b2.capacity());
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.