jhplot.io
Class PReader

java.lang.Object
  extended by jhplot.io.PReader
All Implemented Interfaces:
Serializable

public class PReader
extends Object
implements Serializable

Some generic methods to read data and to return BufferedReader.

See Also:
Serialized Form

Constructor Summary
PReader()
           
 
Method Summary
static BufferedReader read(File sfile)
          Read from a file.
static BufferedReader read(String sfile)
          Read data from a given location.
static BufferedReader read(URL url)
          Read data from URL.
static BufferedReader readGZip(File sfile)
          Read data from a gzipped file (GNU gzip/gunzip commands in linux)
static BufferedReader readGZip(String sfile)
          Read data from either URL or file
static BufferedReader readGZip(URL url)
          Read data from URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PReader

public PReader()
Method Detail

readGZip

public static BufferedReader readGZip(File sfile)
Read data from a gzipped file (GNU gzip/gunzip commands in linux)

Parameters:
sfile - File name with input (extension .gz)
Returns:
zero if success

read

public static BufferedReader read(URL url)
Read data from URL.

Parameters:
url - URL location of input file

read

public static BufferedReader read(File sfile)
Read from a file.

Parameters:
sfile - input file
Returns:
BufferedReader

read

public static BufferedReader read(String sfile)
Read data from a given location. It can read URL if the string starts from http: or ftp:, otherwise a file on the file system is assumed.

Parameters:
sfile - File name or URL with input
Returns:
zero if success

readGZip

public static BufferedReader readGZip(URL url)
Read data from URL.

Parameters:
url - URL location of input file

readGZip

public static BufferedReader readGZip(String sfile)
Read data from either URL or file

Parameters:
sfile - can be either URL or a file location
Returns:
BufferedReader


jHepWork 3.0 ©