/** * Return the name of the index file for the provided {@code filename} and {@code extension} * Does not actually create an index * @param filename name of the file * @param extension the extension to use for the index * @return non-null String representing the index filename */ private static String indexFile(final String filename, final String extension) { return ParsingUtils.appendToPath(filename, extension); }
/** * Srite a string as a null terminated byte array. * * @param s * @throws IOException */ public void writeString(String s) throws IOException { writeBytes(s); write((byte) 0); }
@Override public boolean exists() throws IOException { return this.wrappedHelper.exists(); } }
/** * Split the string into tokesn separated by the given delimiter. Profiling has * revealed that the standard string.split() method typically takes > 1/2 * the total time when used for parsing ascii files. * * @param aString the string to split * @param tokens an array to hold the parsed tokens * @param delim character that delimits tokens * @return the number of tokens parsed */ public static int split(String aString, String[] tokens, char delim) { return split(aString, tokens, delim, false); }
/** * join an array of strings given a seperator * * @param separator the string to insert between each array element * @param strings the array of strings * @return a string, which is the joining of all array values with the separator */ public static String join(String separator, String[] strings) { return join(separator, strings, 0, strings.length); }
@Override public InputStream openInputStream() throws IOException { HttpURLConnection connection = openConnection(); return new WrapperInputStream(connection, connection.getInputStream()); }
/** * @return an input stream from the given path * @throws IOException */ public static InputStream openInputStream(String path) throws IOException { return openInputStream(path, null); }
/** * Return the registered URLHelper, constructed with the provided URL * @see #registerHelperClass(Class) * @param url * @return */ public static URLHelper getURLHelper(URL url) { try { return getURLHelper(urlHelperClass, url); } catch (Exception e) { return getURLHelper(defaultUrlHelperClass, url); } }
@Override public Void apply(String input) { int count = htsjdk.tribble.util.ParsingUtils.split(input, buffer, cdelim); return null; } };
/** * Srite a string as a null terminated byte array. * * @param s * @throws IOException */ public void writeString(String s) throws IOException { writeBytes(s); write((byte) 0); }
/** * join an array of strings given a seperator * * @param separator the string to insert between each array element * @param strings the array of strings * @return a string, which is the joining of all array values with the separator */ public static String join(String separator, String[] strings) { return join(separator, strings, 0, strings.length); }
@Override public InputStream openInputStream() throws IOException { HttpURLConnection connection = openConnection(); return new WrapperInputStream(connection, connection.getInputStream()); }
/** * @return an input stream from the given path * @throws IOException */ public static InputStream openInputStream(String path) throws IOException { return openInputStream(path, null); }
/** * Return the name of the index file for the provided {@code filename} * Does not actually create an index * @param filename * @return */ public static String indexFile(String filename) { return ParsingUtils.appendToPath(filename, STANDARD_INDEX_EXTENSION); }
@Override public boolean exists() throws IOException { return this.wrappedHelper.exists(); } }
/** * Srite a string as a null terminated byte array. * * @param s * @throws IOException */ public void writeString(String s) throws IOException { writeBytes(s); write((byte) 0); }
/** * join an array of strings given a seperator * * @param separator the string to insert between each array element * @param strings the array of strings * @return a string, which is the joining of all array values with the separator */ public static String join(String separator, String[] strings) { return join(separator, strings, 0, strings.length); }
/** * Return the name of the index file for the provided {@code filename} and {@code extension} * Does not actually create an index * @param filename name of the file * @param extension the extension to use for the index * @return non-null String representing the index filename */ private static String indexFile(final String filename, final String extension) { return ParsingUtils.appendToPath(filename, extension); }
@Override public boolean exists() throws IOException { return this.wrappedHelper.exists(); } }