Package org.projecthusky.common.utils
Class Sources
java.lang.Object
org.projecthusky.common.utils.Sources
Utilities to create
Sources.- Author:
- Quentin Ligier
-
Method Summary
Modifier and TypeMethodDescriptionstatic SourcefromByteArray(byte[] bytes) Creates aSourcefrom a byte array.static SourcefromDomDocument(Document document) Creates aSourcefrom a DOM document.static Sourcestatic SourcefromInputStream(InputStream inputStream) Creates aSourcefrom an input stream.static SourcefromString(String string) Creates aSourcefrom a UTF-8 string.
-
Method Details
-
fromFile
- Parameters:
file- The file.- Returns:
- the source.
-
fromInputStream
Creates aSourcefrom an input stream.- Parameters:
inputStream- The input stream.- Returns:
- the source.
-
fromByteArray
Creates aSourcefrom a byte array.- Parameters:
bytes- The byte array.- Returns:
- the source.
-
fromString
Creates aSourcefrom a UTF-8 string.- Parameters:
string- The UTF-8 string.- Returns:
- the source.
-
fromDomDocument
Creates aSourcefrom a DOM document.- Parameters:
document- The DOM document.- Returns:
- the source.
-