Package de.undercouch.citeproc.helper
Class CSLUtils
- java.lang.Object
-
- de.undercouch.citeproc.helper.CSLUtils
-
public class CSLUtils extends Object
Utilities for the CSL processor- Author:
- Michel Kraemer
-
-
Constructor Summary
Constructors Constructor Description CSLUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringreadStreamToString(InputStream is, String encoding)Reads a string from a stream.static StringreadURLToString(URL u, String encoding)Reads a string from a URL
-
-
-
Method Detail
-
readURLToString
public static String readURLToString(URL u, String encoding) throws IOException
Reads a string from a URL- Parameters:
u- the URLencoding- the character encoding- Returns:
- the string
- Throws:
IOException- if the URL contents could not be read
-
readStreamToString
public static String readStreamToString(InputStream is, String encoding) throws IOException
Reads a string from a stream. Closes the stream after reading.- Parameters:
is- the streamencoding- the character encoding- Returns:
- the string
- Throws:
IOException- if the stream contents could not be read
-
-