TikaResourceHelper { static final InputStream[] streamsFromFiles(final File... files) throws FileNotFoundException { InputStream[] streams = new InputStream[files.length]; int strInd = 0; for (File file : files) { streams[strInd++] = new FileInputStream(file); } return streams; } private  TikaResourceHelper();  final static String TIKA_MIMETYPES; final static String CUSTOM_MIMETYPES; }
@SuppressWarnings("javadoc") @Test public final void testStreamsFromFiles() throws URISyntaxException, IOException { List<File> custSigFileLst = new ArrayList<File>(AllFidgetTests.getCustomSigTestFile()); File[] custSigFiles = custSigFileLst.toArray(new File[custSigFileLst.size()]); List<String> sigFileHashes = new ArrayList<String>(); for (File sigFile : custSigFiles) { FileInputStream fis = new FileInputStream(sigFile); sigFileHashes.add(TikaIdentifier.hash64K(fis)); fis.close(); } InputStream[] custSigStreams = TikaResourceHelper.streamsFromFiles(custSigFiles); List<String> sigStrHashes = new ArrayList<String>(); for (InputStream sigStr : custSigStreams) { sigStrHashes.add(TikaIdentifier.hash64K(sigStr)); } assertTrue("Expected some test data", sigStrHashes.size() > 0); assertTrue("Hash lists should be equal", sigFileHashes.equals(sigStrHashes)); }