@ExperimentalUnsignedTypes class BufferedStreamInput : StreamInput
The decorator of StreamInput for buffering.
Author
Alexander Kornilov (akornilov.82@gmail.com).
<init> |
The decorator of StreamInput for buffering. BufferedStreamInput(stream: StreamInput, bufferSize: Int = 4096) |
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. val bytesAvailable: Long |
defaultByteOrder |
Default byte order of the stream. val defaultByteOrder: ByteOrder |
defaultStringEncoding |
Default string encoding of the stream. val defaultStringEncoding: StringEncoding |
isClosed |
Indicate that stream is closed. val isClosed: Boolean |
isEof |
Indicates that end of stream reached. val isEof: Boolean |
isFixedSize |
Indicates that stream has fixed size. val isFixedSize: Boolean |
isNetwork |
Indicates that stream is network based (pipe, socket etc). val isNetwork: Boolean |
isSeekable |
Indicates that position of the stream can be changed. val isSeekable: Boolean |
isSupportLimit |
Indicates that stream support validation of the limit field. 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. 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. val position: Long |
size |
Current stream size in bytes or negative value if size isn't available at moment. val size: Long |
canRead |
Returns fun canRead(bytes: Int): Boolean |
close |
fun close(): Unit |
readByte |
Reads Byte from the stream. fun readByte(): Byte |
readBytes |
Reads bytes size from the stream into the buffer starting from offset. fun readBytes(buffer: ByteArray, size: Int, offset: Int): Int |
readInt |
Read integer value from the stream with specified bytes count and byteOrder.
If signed is fun readInt(bytes: Int, signed: Boolean, byteOrder: ByteOrder): Long |
readLong |
Read integer value from the stream as BigInteger with specified bytes count and byteOrder.
If signed is fun readLong(bytes: Int, signed: Boolean, byteOrder: ByteOrder): BigInteger |
readULong |
Reads ULong from the stream with specified byteOrder. fun readULong(byteOrder: ByteOrder): ULong |
skip |
Skips bytes in the stream. fun skip(bytes: Long): Long |
crc16 |
Calculates CRC16 for size bytes in the stream. fun StreamInput.crc16(size: Int): Int |
crc32 |
Calculates CRC32 for size bytes in the stream. fun StreamInput.crc32(size: Int): Int |