diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementable/stream/Stream.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementable/stream/Stream.kt index 137a610..8d2fed2 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementable/stream/Stream.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementable/stream/Stream.kt @@ -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 + } } /**