binary-streams / loggersoft.kotlin.streams / BasicStream

BasicStream

interface BasicStream : Closeable, AutoCloseable

Root interface of inheritance: contains the most generic properties of any stream.

Author
Alexander Kornilov (akornilov.82@gmail.com).

Properties

bytesAvailable

Contains available bytes for read/write and the negative value if available bytes is not available at moment. Also this property take into account limit value if it has non-negative value and isSupportLimit is true.

open val bytesAvailable: Long

defaultByteOrder

Default byte order of the stream.

abstract val defaultByteOrder: ByteOrder

defaultStringEncoding

Default string encoding of the stream.

abstract val defaultStringEncoding: StringEncoding

isClosed

Indicate that stream is closed.

abstract val isClosed: Boolean

isEof

Indicates that end of stream reached.

open val isEof: Boolean

isFixedSize

Indicates that stream has fixed size.

abstract val isFixedSize: Boolean

isNetwork

Indicates that stream is network based (pipe, socket etc).

abstract val isNetwork: Boolean

isSeekable

Indicates that position of the stream can be changed.

abstract val isSeekable: Boolean

isSupportLimit

Indicates that stream support validation of the limit field.

abstract val isSupportLimit: Boolean

limit

The limit position of the stream for read and write. If someone try to read or write out of this bound (position >= limit) the LimitOutOfBoundsException should be thrown.

abstract val limit: Long

position

Current position in the stream. Has negative value if seek is not supported or information about current position is not available at moment.

abstract val position: Long

size

Current stream size in bytes or negative value if size isn't available at moment.

abstract val size: Long

Inheritors

StreamInput

Represents streams for reading.

interface StreamInput : BasicStream

StreamOutput

Represents streams for writing.

interface StreamOutput : BasicStream, Flushable