Package org.polyfrost.polyui.utils
Class IOUtils
-
- All Implemented Interfaces:
public final class IOUtils
-
-
Method Summary
Modifier and Type Method Description final static InputStreamgetResourceStream(String resourcePath, Class<?> caller)return a stream of the given resource or throws an exception. final static InputStreamgetResourceStreamNullable(String resourcePath, Class<?> caller)return a stream of the given resource, or null. final static BooleanresourceExists(String resourcePath)final static ByteBuffertoByteBuffer(InputStream $self, Boolean close)final static ByteArraytoByteArray(InputStream $self, Boolean close)Converts the InputStream into a byte array and close it. -
-
Method Detail
-
getResourceStream
final static InputStream getResourceStream(String resourcePath, Class<?> caller)
return a stream of the given resource or throws an exception.
- Parameters:
resourcePath- the path to the resource.
-
getResourceStreamNullable
final static InputStream getResourceStreamNullable(String resourcePath, Class<?> caller)
return a stream of the given resource, or null.
- Parameters:
resourcePath- the path to the resource.
-
resourceExists
final static Boolean resourceExists(String resourcePath)
-
toByteBuffer
final static ByteBuffer toByteBuffer(InputStream $self, Boolean close)
-
toByteArray
final static ByteArray toByteArray(InputStream $self, Boolean close)
Converts the InputStream into a byte array and close it.
- Returns:
The byte array of the InputStream.
-
-
-
-