@Test public void testStreamMemory() throws Exception { logger.info("Stream Array / Memory"); testDataSet(StreamFactory.create(Benchmark.fileAsBytes(Shared.getLitePatternV32()))); }
protected static byte[] fileAsBytes(String deviceDataFile) throws IOException { File file = new File(deviceDataFile); byte fileContent[] = new byte[(int) file.length()]; FileInputStream fin = new FileInputStream(file); try { int bytesRead = fin.read(fileContent); if (bytesRead != file.length()) { throw new IllegalStateException("File not completely read"); } } finally { fin.close(); } return fileContent; }
Benchmark { protected static byte[] fileAsBytes(String deviceDataFile) throws IOException { File file = new File(deviceDataFile); byte fileContent[] = new byte[(int) file.length()]; FileInputStream fin = new FileInputStream(file); try { int bytesRead = fin.read(fileContent); if (bytesRead != file.length()) { throw new IllegalStateException("File not completely read"); } } finally { fin.close(); } return fileContent; } }
Benchmark { protected static byte[] fileAsBytes(String deviceDataFile) throws IOException { File file = new File(deviceDataFile); byte fileContent[] = new byte[(int) file.length()]; FileInputStream fin = new FileInputStream(file); try { int bytesRead = fin.read(fileContent); if (bytesRead != file.length()) { throw new IllegalStateException("File not completely read"); } } finally { fin.close(); } return fileContent; } Benchmark(String userAgentFile); }
Benchmark { protected static byte[] fileAsBytes(String deviceDataFile) throws IOException { File file = new File(deviceDataFile); byte fileContent[] = new byte[(int) file.length()]; FileInputStream fin = new FileInputStream(file); try { int bytesRead = fin.read(fileContent); if (bytesRead != file.length()) { throw new IllegalStateException("File not completely read"); } } finally { fin.close(); } return fileContent; } Benchmark(String userAgentFile); double getAverageDetectionTimePerThread(); int getCount(); void run(Dataset dataSet, int numberOfThreads); static void main(String[] args); }
Benchmark { protected static byte[] fileAsBytes(String deviceDataFile) throws IOException { File file = new File(deviceDataFile); byte fileContent[] = new byte[(int) file.length()]; FileInputStream fin = new FileInputStream(file); try { int bytesRead = fin.read(fileContent); if (bytesRead != file.length()) { throw new IllegalStateException("File not completely read"); } } finally { fin.close(); } return fileContent; } Benchmark(String userAgentFile); double getAverageDetectionTimePerThread(); int getCount(); void run(Dataset dataSet, int numberOfThreads); static void main(String[] args);  }