Package org.syncany.chunk

Examples of org.syncany.chunk.FixedChunker


  public void testChunkFileIntoMultiChunks() throws Exception {
    int minMultiChunkSize = 512;
    int chunkSizeB = 16000;

    Chunker[] chunkers = new Chunker[] {
      new FixedChunker(chunkSizeB)
    };
   
    MultiChunker[] multiChunkers = new MultiChunker[] {
      //new CustomMultiChunker(minMultiChunkSize),
      new ZipMultiChunker(minMultiChunkSize)
View Full Code Here


  @Test
  public void testStringSerialization() {
    final int CHUNK_SIZE = 512*1024;
   
    Chunker chunker = new FixedChunker(CHUNK_SIZE);
    assertEquals("Other toString() result expected.", "Fixed-"+CHUNK_SIZE+"-"+FixedChunker.DEFAULT_DIGEST_ALG, chunker.toString());
  }
View Full Code Here

    File inputRandom5MBFile = TestFileUtil.createRandomFileInDirectory(tempDir, TOTAL_FILE_SIZE);
   
    File outputCopyOfRandom5MBFile = TestFileUtil.getRandomFilenameInDirectory(tempDir);
    FileOutputStream outputCopyOfRandom5MBFileOutputStream = new FileOutputStream(outputCopyOfRandom5MBFile);
   
    Chunker chunker = new FixedChunker(EXACT_CHUNK_SIZE, FixedChunker.DEFAULT_DIGEST_ALG);
   
    // Create chunks
    int actualChunkCount = 0;
    Enumeration<Chunk> chunkEnumeration = chunker.createChunks(inputRandom5MBFile);
    Chunk lastChunk = null;
   
    while (chunkEnumeration.hasMoreElements()) {
      actualChunkCount++;
      lastChunk = chunkEnumeration.nextElement();
View Full Code Here

    final int TOTAL_FILE_SIZE = 5*1024;
    final int EXACT_CHUNK_SIZE = 512*1024;
   
    // Setup       
    File inputFile = TestFileUtil.createRandomFileInDirectory(tempDir, TOTAL_FILE_SIZE);   
    Chunker chunker = new FixedChunker(EXACT_CHUNK_SIZE);
   
    // Create chunks
    Enumeration<Chunk> chunkEnumeration = chunker.createChunks(inputFile);
   
    while (chunkEnumeration.hasMoreElements()) {
      chunkEnumeration.nextElement();
    }
   
View Full Code Here

  @Test
  public void testExceptionInvalidDigestAlgorithm() {
    boolean exceptionThrown = false;
   
    try {
      new FixedChunker(1337, "does-not-exist").createChunks(new File("/some/file"));
    }
    catch (Exception e) {
      exceptionThrown = true;
    }
   
View Full Code Here

  private void initChunker(RepoTO repoTO) throws Exception {
    // TODO [feature request] make chunking options configurable, something like described in #29
    // See: https://github.com/syncany/syncany/issues/29#issuecomment-43425647

    chunker = new FixedChunker(512 * 1024, "SHA1");
  }
View Full Code Here

TOP

Related Classes of org.syncany.chunk.FixedChunker

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.