Package freenet.support

Examples of freenet.support.BitArray


    this.usm = usm;
    long blocks = (size + blockSize - 1) / blockSize;
    if(blocks > Integer.MAX_VALUE)
      throw new IllegalArgumentException("Too big");
    this.blocks = (int)blocks;
    blocksReceived = new BitArray(this.blocks);
    if(initialState) {
      blocksReceived.setAllOnes();
      blocksReceivedCount = this.blocks;
    }
    assert(raf.size() >= size);
View Full Code Here


   * Clone the blocksReceived BitArray. Used by BulkTransmitter to find what blocks are available on
   * creation. BulkTransmitter will have already taken the lock and will keep it over the add() also.
   * @return A copy of blocksReceived.
   */
  synchronized BitArray cloneBlocksReceived() {
    return new BitArray(blocksReceived);
  }
View Full Code Here

    _prb = source;
    _ctr = ctr;
    if(_ctr == null) throw new NullPointerException();
    PACKET_SIZE = DMT.packetTransmitSize(_prb._packetSize, _prb._packets);
    try {
      _sentPackets = new BitArray(_prb.getNumPackets());
    } catch (AbortedException e) {
      Logger.error(this, "Aborted during setup");
      // Will throw on running
    }
    this.blockTimeCallback = blockTimes;
View Full Code Here

        running = true;
      }
      try {
        while(true) {
          int packetNo = -1;
          BitArray copy;
          synchronized(_senderThread) {
            if(_failed || _receivedSendCompletion || _completed) return;
            if(_unsent.size() == 0) {
              // Wait for PRB callback to tell us we have more packets.
              return;
View Full Code Here

TOP

Related Classes of freenet.support.BitArray

Copyright © 2018 www.massapicom. 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.