private static InputStream[] filesToInputStreams(final File[] files) { final InputStream[] result = new InputStream[files.length]; for (int i = 0; i < files.length; i++) { result[i] = IOUtil.openFileForReading(files[i]); } return result; } }
private static InputStream[] filesToInputStreams(final File[] files) { final InputStream[] result = new InputStream[files.length]; for (int i = 0; i < files.length; i++) { result[i] = IOUtil.openFileForReading(files[i]); } return result; } }
/** * Opens a file for reading, decompressing it if necessary * * @param file The file to open * @return the input stream to read from */ public static BufferedReader openFileForBufferedUtf8Reading(final File file) { return new BufferedReader(new InputStreamReader(openFileForReading(file), Charset.forName("UTF-8"))); }
/** Checks that a path exists and is readable, and then returns a buffered reader for it. */ public static BufferedReader openFileForBufferedReading(final Path path) { return new BufferedReader(new InputStreamReader(openFileForReading(path)), Defaults.NON_ZERO_BUFFER_SIZE); }
/** Checks that a file exists and is readable, and then returns a buffered reader for it. */ public static BufferedReader openFileForBufferedReading(final File file) { return new BufferedReader(new InputStreamReader(openFileForReading(file)), Defaults.NON_ZERO_BUFFER_SIZE); }
/** Checks that a path exists and is readable, and then returns a buffered reader for it. */ public static BufferedReader openFileForBufferedReading(final Path path) { return new BufferedReader(new InputStreamReader(openFileForReading(path)), Defaults.NON_ZERO_BUFFER_SIZE); }
/** * Opens a file for reading, decompressing it if necessary * * @param file The file to open * @return the input stream to read from */ public static BufferedReader openFileForBufferedUtf8Reading(final File file) { return new BufferedReader(new InputStreamReader(openFileForReading(file), Charset.forName("UTF-8"))); }
/** * Opens a file for reading, decompressing it if necessary * * @param file The file to open * @return the input stream to read from */ public static BufferedReader openFileForBufferedUtf8Reading(final File file) { return new BufferedReader(new InputStreamReader(openFileForReading(file), Charset.forName("UTF-8"))); }
/** Constructs a FastaSequenceFile that reads from the specified file. */ public FastaSequenceFile(final Path path, final boolean truncateNamesAtWhitespace) { super(path); this.truncateNamesAtWhitespace = truncateNamesAtWhitespace; this.seekableStream = null; this.in = new FastLineReader(IOUtil.openFileForReading(path)); }
/** * Opens a file for reading, decompressing it if necessary * * @param file The file to open * @return the input stream to read from */ public static InputStream openFileForReading(final File file) { return openFileForReading(toPath(file)); }
/** * Opens a file for reading, decompressing it if necessary * * @param file The file to open * @return the input stream to read from */ public static InputStream openFileForReading(final File file) { return openFileForReading(toPath(file)); }
/** Constructs a FastaSequenceFile that reads from the specified file. */ public FastaSequenceFile(final Path path, final boolean truncateNamesAtWhitespace) { super(path); this.truncateNamesAtWhitespace = truncateNamesAtWhitespace; this.seekableStream = null; this.in = new FastLineReader(IOUtil.openFileForReading(path)); }
/** Constructs a FastaSequenceFile that reads from the specified file. */ public FastaSequenceFile(final File file, final boolean truncateNamesAtWhitespace) { super(file); this.truncateNamesAtWhitespace = truncateNamesAtWhitespace; this.in = new FastLineReader(IOUtil.openFileForReading(file)); }
public void reset() { this.sequenceIndex = -1; this.in.close(); this.in = new FastLineReader(IOUtil.openFileForReading(file)); }
@DataProvider(name = "multiFileParsingData") private Object[][] getMultiFileParsingData() { return new Object[][] { {new File(testFile1), new File(testFile1)}, {IOUtil.openFileForReading(new File(testFile1)), IOUtil.openFileForReading(new File(testFile1))} }; }
@DataProvider(name = "noGroupingData") private Object[][] getNoGroupingData() { return new Object[][] { {new File(testFile3)}, {IOUtil.openFileForReading(new File(testFile3))} }; }
@DataProvider(name = "basicInputParserData") private Object[][] getBasicInputParserData() { return new Object[][] { {new File(testFile1)}, {IOUtil.openFileForReading(new File(testFile1))} }; }
@DataProvider(name = "leadingWhiteSpaceData") private Object[][] getLeadingWhiteSpaceData() { return new Object[][] { {new File(testFile2)}, {IOUtil.openFileForReading(new File(testFile2))} }; }
@DataProvider(name = "tooManyWordsData") private Object[][] getTooManyWordsData() { return new Object[][] { {new File(testFile1)}, {IOUtil.openFileForReading(new File(testFile1))} }; }
@DataProvider(name = "tabbedData") private Object[][] getTabbedData() { return new Object[][] { {new File(testFile4)}, {IOUtil.openFileForReading(new File(testFile4))} }; }