Add allowsReading and allowsWriting methods
All checks were successful
PRs & Pushes / test (push) Successful in 3m9s
PRs & Pushes / build-jars (push) Successful in 3m43s
PRs & Pushes / build-apidoc (push) Successful in 3m42s

This commit is contained in:
JeremyStar™ 2025-01-10 21:41:54 +01:00
parent f9fc1e8ccf
commit e85cdf9445
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -700,7 +700,33 @@ abstract class Stream(
*
* @since v1-alpha10
*/
READ_WRITE,
READ_WRITE;
/**
* Returns whether this mode
* allows stream reading.
*
* @return allows reading?
* @since v1-alpha10
*/
fun allowsReading(): Boolean = when(this) {
READ -> true
WRITE -> false
READ_WRITE -> true
}
/**
* Returns whether this mode
* allows stream reading.
*
* @return allows reading?
* @since v1-alpha10
*/
fun allowsWriting(): Boolean = when(this) {
READ -> false
WRITE -> true
READ_WRITE -> true
}
}
/**