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 ByteBuffertoDirectByteBuffer(InputStream $self)final static ByteBuffertoDirectByteBufferNT(InputStream $self)toDirectByteBuffer with a null terminator. final static ByteArraytoByteArray(InputStream $self)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)
-
toDirectByteBuffer
final static ByteBuffer toDirectByteBuffer(InputStream $self)
-
toDirectByteBufferNT
final static ByteBuffer toDirectByteBufferNT(InputStream $self)
toDirectByteBuffer with a null terminator.
- Since:
1.1.6
-
toByteArray
final static ByteArray toByteArray(InputStream $self)
Converts the InputStream into a byte array and close it.
- Returns:
The byte array of the InputStream.
-
-
-
-