Package org.syncany.chunk

Examples of org.syncany.chunk.MultiChunker


      return reconstructedFileInCache;
    }
       
    // Create non-empty file
    Chunker chunker = config.getChunker();
    MultiChunker multiChunker = config.getMultiChunker();
   
    FileOutputStream reconstructedFileOutputStream = new FileOutputStream(reconstructedFileInCache);   
    MessageDigest reconstructedFileChecksum = MessageDigest.getInstance(chunker.getChecksumAlgorithm());
   
    if (fileContent != null) { // File can be empty!
      Collection<ChunkChecksum> fileChunks = fileContent.getChunks();

      for (ChunkChecksum chunkChecksum : fileChunks) {
        MultiChunkId multiChunkIdForChunk = localDatabase.getMultiChunkId(chunkChecksum);

        if (multiChunkIdForChunk == null && memoryDatabase != null) {
          multiChunkIdForChunk = memoryDatabase.getMultiChunkIdForChunk(chunkChecksum);
        }

        File decryptedMultiChunkFile = config.getCache().getDecryptedMultiChunkFile(multiChunkIdForChunk);

        MultiChunk multiChunk = multiChunker.createMultiChunk(decryptedMultiChunkFile);
        InputStream chunkInputStream = multiChunk.getChunkInputStream(chunkChecksum.getBytes());

            byte[] buffer = new byte[4096];
            int read = 0;
View Full Code Here

TOP

Related Classes of org.syncany.chunk.MultiChunker

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.