Top Description Constructors Methods
de.undercouch.citeproc.helper

public Class CSLUtils

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.net.HttpURLConnection, .URL, .URLConnection

Utilities for the CSL processor
Author
Michel Kraemer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the string
readStreamToString
(InputStream
the stream
is
,
String
the character encoding
encoding
)

Reads a string from a stream.

public static String

Returns:

the string
readURLToString
(URL
the URL
u
,
String
the character encoding
encoding
)

Reads a string from a URL

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CSLUtilsback to summary
public CSLUtils()

Method Detail

readStreamToStringback to summary
public static String readStreamToString(InputStream is, String encoding) throws IOException

Reads a string from a stream. Closes the stream after reading.

Parameters
is:InputStream

the stream

encoding:String

the character encoding

Returns:String

the string

Exceptions
IOException:
if the stream contents could not be read
readURLToStringback to summary
public static String readURLToString(URL u, String encoding) throws IOException

Reads a string from a URL

Parameters
u:URL

the URL

encoding:String

the character encoding

Returns:String

the string

Exceptions
IOException:
if the URL contents could not be read