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