@ExperimentalUnsignedTypes class StreamByteArea : AbstractStream, ByteAreaBased
Implementation of the Stream for ByteArea (in fact for any ByteAreaBased objects).
Author
Alexander Kornilov (akornilov.82@gmail.com).
<init> |
Implementation of the Stream for ByteArea (in fact for any ByteAreaBased objects). StreamByteArea(data: ByteAreaBased, readOnly: Boolean = false, checkLimit: Boolean = false) |
byteArea |
The object's byte area. val byteArea: ByteArea |
isFixedSize |
val isFixedSize: Boolean |
isReadable |
Indicates that stream is readable. val isReadable: Boolean |
isSeekable |
val isSeekable: Boolean |
isSupportLimit |
val isSupportLimit: Boolean |
isWritable |
Indicates that stream is writable. val isWritable: Boolean |
size |
val size: Long |
close |
fun close(): Unit |
flush |
fun flush(): 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 |
writeByte |
Writes Byte into the stream. fun writeByte(value: Byte): Unit |
writeBytes |
Writes size bytes of buffer starting from offset into the stream. fun writeBytes(buffer: ByteArray, size: Int, offset: Int): Unit |
writeInt |
Writes value with size in bytes with specified byteOrder into the stream. The bytes should be in 1..8 range. fun writeInt(value: Long, bytes: Int, byteOrder: ByteOrder): Unit |
writeLong |
Writes value with size in bytes with specified byteOrder into the stream. fun writeLong(value: BigInteger, bytes: Int, byteOrder: ByteOrder): Unit |
writeULong |
Writes ULong with specified byteOrder into the stream. fun writeULong(value: ULong, byteOrder: ByteOrder): Unit |
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 |
setLimit |
Sets current stream position and limit. e.g. after setLimit(10, 5) the stream position will be 10 and limit 15. fun Stream.setLimit(position: Long, limit: Long): Unit |
tryDetectBom |
Tries detect BOM signature in current position and if success updates Stream.defaultByteOrder and Stream.defaultStringEncoding. fun Stream.tryDetectBom(): Boolean |