Package com.spinyowl.legui.util
Class IOUtil
java.lang.Object
com.spinyowl.legui.util.IOUtil
IO utility. Used to read resource as
ByteBuffer or as String..-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteBufferToString(ByteBuffer byteBuffer) Used to transfer buffer data toString.static StringbyteBufferToString(ByteBuffer byteBuffer, Charset charset) Used to transfer buffer data toString.static ByteBufferresourceToByteBuffer(File file) CreatesByteBufferfrom file.static ByteBufferresourceToByteBuffer(InputStream stream) CreatesByteBufferfrom stream.static ByteBufferresourceToByteBuffer(String path) CreatesByteBufferfrom: file resource url (http/https) protocolstatic StringresourceToString(File file) CreatesStringfrom file.static StringresourceToString(InputStream stream) CreatesStringfrom stream.static StringresourceToString(String path) CreatesStringfrom file or resource.
-
Method Details
-
resourceToByteBuffer
CreatesByteBufferfrom:- file
- resource
- url (http/https) protocol
- Parameters:
path- path to file or resource.- Returns:
- file or resource data or null.
- Throws:
IOException- in case if any IO exception occurs.
-
resourceToByteBuffer
CreatesByteBufferfrom stream.- Parameters:
stream- stream to read.- Returns:
- stream data or null.
- Throws:
IOException- in case if any IO exception occurs.
-
resourceToByteBuffer
CreatesByteBufferfrom file.- Parameters:
file- file to read.- Returns:
- file or null.
- Throws:
IOException- in case if any IO exception occurs.
-
resourceToString
CreatesStringfrom file or resource.- Parameters:
path- path to file or resource.- Returns:
- String from file or resource data or null.
- Throws:
IOException- in case if any IO exception occurs.
-
resourceToString
CreatesStringfrom stream.- Parameters:
stream- stream to read.- Returns:
- String from stream data or null.
- Throws:
IOException- in case if any IO exception occurs.
-
resourceToString
CreatesStringfrom file.- Parameters:
file- file to read.- Returns:
- String from file or null.
- Throws:
IOException- in case if any IO exception occurs.
-
byteBufferToString
Used to transfer buffer data toString.- Parameters:
byteBuffer- data to transfer- Returns:
- string or null.
-
byteBufferToString
Used to transfer buffer data toString.- Parameters:
byteBuffer- data to transfer- Returns:
- string or null.
-