Package freenet.support

Examples of freenet.support.ByteArrayWrapper


    os.close();
    }
   
    DiskBlock stored = new DiskBlock();
    stored.data = bucket;
    purgeOldData(new ByteArrayWrapper(routingkey), stored);
  }
View Full Code Here


    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pk.put(hash, key, false);
      assertTrue(pk.fetch(hash, false, false, null).equals(key));
    }
    int x = 0;
View Full Code Here

    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pubkeys.cacheKey(hash, key, false, false, false, false, false);
      assertTrue(pubkeys.getKey(hash, false, false, null).equals(key));
    }
    int x = 0;
View Full Code Here

   *
   * @param plainKey
   * @return
   */
  byte[] getDigestedKey(byte[] plainKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(plainKey);
    synchronized (digestRoutingKeyCache) {
      byte[] dk = digestRoutingKeyCache.get(key);
      if (dk != null)
        return dk;
    }
View Full Code Here

  @Override
  public T fetch(byte[] routingKey, byte[] fullKey,
      boolean dontPromote, boolean canReadClientCache,
      boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta)
      throws IOException {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
   
    Block<T> block = null;
   
    configLock.readLock().lock();
    try {
View Full Code Here

    return backDatastore.misses();
  }

  @Override
  public boolean probablyInStore(byte[] routingKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
    Block<T> block = null;
   
    configLock.readLock().lock();
    try {
      block = blocksByRoutingKey.get(key);
View Full Code Here

  @Override
  public void put(T block, byte[] data, byte[] header,
      boolean overwrite, boolean isOldBlock) throws IOException,
      KeyCollisionException {
    byte[] routingKey = block.getRoutingKey();
    final ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
   
    Block<T> storeBlock = new Block<T>();
    storeBlock.block = block;
    storeBlock.data = data;
    storeBlock.header = header;
View Full Code Here

TOP

Related Classes of freenet.support.ByteArrayWrapper

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.