public class CSLUtils extends Object
| Constructor and Description |
|---|
CSLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
readFileToString(File f,
String encoding)
Reads a string from a file.
|
static byte[] |
readStream(InputStream is)
Reads a byte array from a stream.
|
static String |
readStreamToString(InputStream is,
String encoding)
Reads a string from a stream.
|
static byte[] |
readURL(URL url)
Reads a byte array from a URL
|
static String |
readURLToString(URL u,
String encoding)
Reads a string from a URL
|
public static String readURLToString(URL u, String encoding) throws IOException
u - the URLencoding - the character encodingIOException - if the URL contents could not be readpublic static String readFileToString(File f, String encoding) throws IOException
f - the fileencoding - the character encodingIOException - if the file contents could not be readpublic static String readStreamToString(InputStream is, String encoding) throws IOException
is - the streamencoding - the character encodingIOException - if the stream contents could not be readpublic static byte[] readURL(URL url) throws IOException
url - the URLIOException - if the URL contents could not be readpublic static byte[] readStream(InputStream is) throws IOException
is - the streamIOException - if the stream contents could not be read