@@ -1488,7 +1488,7 @@ public static LinkedList<String[]> readCSVStrictly(String filename, int numColum
14881488 }
14891489
14901490 /**
1491- * Get a input file stream (automatically gunzip/bunzip2 depending on file extension)
1491+ * Get a input file stream (automatically gunzip depending on file extension)
14921492 * @param filename Name of file to open
14931493 * @return Input stream that can be used to read from the file
14941494 * @throws IOException if there are exceptions opening the file
@@ -1497,15 +1497,12 @@ public static InputStream getFileInputStream(String filename) throws IOException
14971497 InputStream in = new FileInputStream (filename );
14981498 if (filename .endsWith (".gz" )) {
14991499 in = new GZIPInputStream (in );
1500- } else if (filename .endsWith (".bz2" )) {
1501- //in = new CBZip2InputStream(in);
1502- in = getBZip2PipedInputStream (filename );
15031500 }
15041501 return in ;
15051502 }
15061503
15071504 /**
1508- * Get a output file stream (automatically gzip/bzip2 depending on file extension)
1505+ * Get a output file stream (automatically gzip depending on file extension)
15091506 * @param filename Name of file to open
15101507 * @return Output stream that can be used to write to the file
15111508 * @throws IOException if there are exceptions opening the file
@@ -1514,9 +1511,6 @@ public static OutputStream getFileOutputStream(String filename) throws IOExcepti
15141511 OutputStream out = new FileOutputStream (filename );
15151512 if (filename .endsWith (".gz" )) {
15161513 out = new GZIPOutputStream (out );
1517- } else if (filename .endsWith (".bz2" )) {
1518- //out = new CBZip2OutputStream(out);
1519- out = getBZip2PipedOutputStream (filename );
15201514 }
15211515 return out ;
15221516 }
@@ -1525,9 +1519,6 @@ public static OutputStream getFileOutputStream(String filename, boolean append)
15251519 OutputStream out = new FileOutputStream (filename , append );
15261520 if (filename .endsWith (".gz" )) {
15271521 out = new GZIPOutputStream (out );
1528- } else if (filename .endsWith (".bz2" )) {
1529- //out = new CBZip2OutputStream(out);
1530- out = getBZip2PipedOutputStream (filename );
15311522 }
15321523 return out ;
15331524 }
@@ -1584,22 +1575,6 @@ public static PrintWriter getPrintWriter(String filename, String encoding) throw
15841575 return new PrintWriter (new BufferedWriter (new OutputStreamWriter (out , encoding )), true );
15851576 }
15861577
1587- public static InputStream getBZip2PipedInputStream (String filename ) throws IOException {
1588- String bzcat = System .getProperty ("bzcat" , "bzcat" );
1589- Runtime rt = Runtime .getRuntime ();
1590- String cmd = bzcat + " " + filename ;
1591- //log.info("getBZip2PipedInputStream: Running command: "+cmd);
1592- Process p = rt .exec (cmd );
1593- Writer errWriter = new BufferedWriter (new OutputStreamWriter (System .err ));
1594- StreamGobbler errGobbler = new StreamGobbler (p .getErrorStream (), errWriter );
1595- errGobbler .start ();
1596- return p .getInputStream ();
1597- }
1598-
1599- public static OutputStream getBZip2PipedOutputStream (String filename ) throws IOException {
1600- return new BZip2PipedOutputStream (filename );
1601- }
1602-
16031578 private static final Pattern tab = Pattern .compile ("\t " );
16041579
16051580 /**
0 commit comments