@Test public void testNextChunkEvenIfThereAreNone() throws IOException { final int TOTAL_FILE_SIZE = 5*1024; final int CHUNK_SIZE = 512*1024; File inputFile = TestFileUtil.createRandomFileInDirectory(tempDir, TOTAL_FILE_SIZE); Chunker chunker = new TttdChunker(CHUNK_SIZE); Enumeration<Chunk> chunkEnumeration = chunker.createChunks(inputFile); while (chunkEnumeration.hasMoreElements()) { chunkEnumeration.nextElement(); } assertNull("No chunk expected, but data received.", chunkEnumeration.nextElement()); assertFalse("hasElements() should return 'false' if no chunk available.", chunkEnumeration.hasMoreElements()); }
@Override public ChunkEnumeration createChunks(File file) throws IOException { return new TTTDEnumeration(new FileInputStream(file)); }
TttdChunker extends Chunker { @Override public ChunkEnumeration createChunks(File file) throws IOException { return new TTTDEnumeration(new FileInputStream(file)); } }
TttdChunker extends Chunker { @Override public ChunkEnumeration createChunks(File file) throws IOException { return new TTTDEnumeration(new FileInputStream(file)); } TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg);  TttdChunker(int avgChunkSize);  TttdChunker(int avgChunkSize, int windowSize, String digestAlg, String fingerprintAlg);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg); private  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg, String name); }
TttdChunker extends Chunker { @Override public ChunkEnumeration createChunks(File file) throws IOException { return new TTTDEnumeration(new FileInputStream(file)); } TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg);  TttdChunker(int avgChunkSize);  TttdChunker(int avgChunkSize, int windowSize, String digestAlg, String fingerprintAlg);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg); private  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg, String name); @Override ChunkEnumeration createChunks(File file); @Override String getChecksumAlgorithm(); @Override String toString(); }
TttdChunker extends Chunker { @Override public ChunkEnumeration createChunks(File file) throws IOException { return new TTTDEnumeration(new FileInputStream(file)); } TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg);  TttdChunker(int avgChunkSize);  TttdChunker(int avgChunkSize, int windowSize, String digestAlg, String fingerprintAlg);  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg); private  TttdChunker(int Tmin, int Tmax, int D, int Ddash, int windowSize, String digestAlg, String fingerprintAlg, String name); @Override ChunkEnumeration createChunks(File file); @Override String getChecksumAlgorithm(); @Override String toString(); static final int DEFAULT_WINDOW_SIZE; static final String DEFAULT_DIGEST_ALG; static final String DEFAULT_FINGERPRINT_ALG; }