Package freenet.support.api

Examples of freenet.support.api.RandomAccessBucket.free()


            assertTrue(readBytes > 0);
            assertTrue(Arrays.equals(Arrays.copyOfRange(buf, 0, readBytes), Arrays.copyOfRange(data, moved, moved+readBytes)));
            moved += readBytes;
        }
        is.close();
        bucket.free();
    }
   
    public void testIrregularWritesNotOverlapping() throws IOException {
        Random r = new Random(6032405);
        int length = 1024*64+1;
 
View Full Code Here


            assertTrue(readBytes > 0);
            assertTrue(Arrays.equals(Arrays.copyOfRange(buf, 0, readBytes), Arrays.copyOfRange(data, moved, moved+readBytes)));
            moved += readBytes;
        }
        is.close();
        bucket.free();
    }
   
    public void testBucketToRAF() throws IOException {
        Random r = new Random(6032405);
        int length = 1024*64+1;
 
View Full Code Here

        } catch (InsertException e) {
          e.printStackTrace();
          csvLine.add("N/A");
        }

        data.free();
      }

      node.park();

      // Node 2
View Full Code Here

      } catch (InsertException e) {
        e.printStackTrace();
        csvLine.add("N/A");
      }

      data.free();

      node.park();

      // Node 2
      File innerDir2 = new File(dir, Integer.toString(DARKNET_PORT2));
View Full Code Here

          e.printStackTrace();
          csvLine.add("N/A");
          csvLine.add("N/A");
        }

        data.free();
      }

      node.park();

      // Node 2
View Full Code Here

            content.addChild("br");
            addHomepageLink(content);

            writeHTMLReply(ctx, 200, "OK", pageNode.generate());
            request.freeParts();
            bucket.free();
        } else if (request.isPartSet("exit")) {
          PageNode page = ctx.getPageMaker().getPageNode(l10n("shutdownConfirmTitle"), ctx);
            HTMLNode pageNode = page.outer;
            HTMLNode contentNode = page.content;
            HTMLNode content = ctx.getPageMaker().getInfobox("infobox-query", l10n("shutdownConfirmTitle"), contentNode, "shutdown-confirm", true);
View Full Code Here

          b.setReadOnly(); // Must be after dos.close()
          success = true;
          return b;
      } finally {
          Closer.close(dos);
          if(!success) b.free();
      }
  }

  public boolean isResolved() {
    return (resolvedURI != null) || (resolvedName != null);
View Full Code Here

          shouldFreeOnFinally = true;
          if(bestCompressedData != null && bestCompressedData != origData && bestCompressedData != result)
            bestCompressedData.free();
        } finally {
          if(shouldFreeOnFinally && (result != null) && result != origData)
            result.free();
        }
      }
     
      final CompressionOutput output = new CompressionOutput(bestCompressedData, bestCodec, hashes);
     
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.