MemoryStream

Creates a stream whose backing store is memory.

Constructors

Link copied to clipboard
constructor()
Initializes a new instance of the MemoryStream class with an expandable capacity initialized to zero.
constructor(capacity: Int)
Initializes a new instance of the MemoryStream class with an expandable capacity initialized as specified.
constructor(buffer: Array<Byte>)
Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array.
constructor(buffer: Array<Byte>, writable: Boolean)
Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array, with writable set as specified.
constructor(buffer: Array<Byte>, index: Int, count: Int)
Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array.
constructor(buffer: Array<Byte>, index: Int, count: Int, writable: Boolean)
Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with writable set as specified.
constructor(buffer: Array<Byte>, index: Int, count: Int, writable: Boolean, publiclyVisible: Boolean)
Initializes a new instance of the MemoryStream class based on the specified region of a byte array, with writable set as specified, and publiclyVisible set as specified.

Properties

Link copied to clipboard
open val buffer: Array<Byte>
Link copied to clipboard
open var capacity: Int

Functions

Link copied to clipboard
Get an OutputStream that will write to this MemoryStream, at the current position.
Link copied to clipboard
open fun available(): Int
Link copied to clipboard
open fun close()
Link copied to clipboard
open fun getLength(): Long
Gets the length of the stream in bytes.
Link copied to clipboard
open fun getPosition(): Long
Gets the current position within the stream.
Link copied to clipboard
open fun mark(readAheadLimit: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun read(): Int
open fun read(b: Array<Byte>, off: Int, len: Int): Int
Link copied to clipboard
open fun readAllBytes(): Array<Byte>
Link copied to clipboard
open fun readNBytes(len: Int): Array<Byte>
open fun readNBytes(b: Array<Byte>, off: Int, len: Int): Int
Link copied to clipboard
open fun reset()
Link copied to clipboard
open fun seek(offset: Long, loc: SeekOrigin): Long
Sets the position within the current stream to the specified value.
Link copied to clipboard
open fun setLength(value: Long)
Sets the length of this stream to the given value.
Link copied to clipboard
open fun setPosition(value: Long)
Sets the current position within the stream.
Link copied to clipboard
open fun skip(n: Long): Long
Link copied to clipboard
open fun toByteArray(): Array<Byte>
Link copied to clipboard
open fun transferTo(out: OutputStream): Long
Link copied to clipboard
open fun write(buffer: Array<Byte>, offset: Int, count: Int)
Writes a block of bytes to the current stream using data read from buffer.
Link copied to clipboard
open fun writeByte(value: Byte)