@Test @Category(org.datavaultplatform.SlowTest.class) public void testSplit500MBFile() { System.out.println( "\nStart testSplit500MBFile"); try{ File inputFile = new File(bigFileResources, "500MB_file"); long bytesPerChunk = 100 * 1000 * 1000; long start = System.currentTimeMillis(); File[] chunks = FileSplitter.spliteFile(inputFile, bytesPerChunk, tempDir); long elapsedTimeMillis = System.currentTimeMillis()-start; float elapsedTimeSec = elapsedTimeMillis/1000F; System.out.println( "Total time: " + elapsedTimeSec + "sec"); assertEquals(5, chunks.length); for(File chunk : chunks){ assertEquals(bytesPerChunk, chunk.length()); chunk.delete(); } } catch(SecurityException se) { se.printStackTrace(); fail(se.getMessage()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
public static File[] spliteFile(File inputFile) throws Exception { return spliteFile(inputFile, DEFAULT_CHUNK_SIZE, inputFile.getParentFile()); }
FileSplitter { public static File[] spliteFile(File inputFile) throws Exception { return spliteFile(inputFile, DEFAULT_CHUNK_SIZE, inputFile.getParentFile()); } }
FileSplitter { public static File[] spliteFile(File inputFile) throws Exception { return spliteFile(inputFile, DEFAULT_CHUNK_SIZE, inputFile.getParentFile()); }  }
FileSplitter { public static File[] spliteFile(File inputFile) throws Exception { return spliteFile(inputFile, DEFAULT_CHUNK_SIZE, inputFile.getParentFile()); }  static File[] spliteFile(File inputFile); static File[] spliteFile(File inputFile, long bytesPerChunk); static File[] spliteFile(File inputFile, long bytesPerChunk, File outputDir); static File recomposeFile(File[] inputFiles, File outputFile); }
FileSplitter { public static File[] spliteFile(File inputFile) throws Exception { return spliteFile(inputFile, DEFAULT_CHUNK_SIZE, inputFile.getParentFile()); }  static File[] spliteFile(File inputFile); static File[] spliteFile(File inputFile, long bytesPerChunk); static File[] spliteFile(File inputFile, long bytesPerChunk, File outputDir); static File recomposeFile(File[] inputFiles, File outputFile); static int DEFAULT_CHUNK_SIZE; static int BUFFER_SIZE; static String CHUNK_SEPARATOR; }