Creates a new memory stream with reserved bytes of memory.
Takes ownership of an existing buffer.
Destructor.
Closes the stream.
Clears all buffers of the stream and causes data to be written to the underlying device.
Reads bytes from the specified stream in to the specified buffer
Sets the reading position within the stream
Takes ownership of the memory in the memory stream, causing the memory stream to reset to its initial state.
Writes bytes from the specified buffer in to the stream
Whether the stream can be flushed to disk.
Whether the stream can be read from.
Whether the stream can be seeked.
Whether the stream can timeout during operations.
Whether the stream can be written to.
Length of the stream.
Timeout in milliseconds before a read operation will fail.
Position in stream
Timeout in milliseconds before a write operation will fail.
Whether the stream can be read from.
Whether the stream can be written to.
Whether the stream can be seeked.
Whether the stream can timeout during operations.
Whether the stream can be flushed to disk.
Length of the stream.
Position in stream
Timeout in milliseconds before a read operation will fail.
Timeout in milliseconds before a write operation will fail.
Clears all buffers of the stream and causes data to be written to the underlying device.
Sets the reading position within the stream
Closes the stream.
Reads bytes from the specified stream in to the specified buffer
Writes bytes from the specified buffer in to the stream
Generally, memory streams are safe to use as long as you do not mess with their ownership semantics; when passing an existing buffer to the memory stream, make sure that no other variable is referencing the backing buffer. The buffer's memory address may change during resize operations, which can lead to stale pointers outside of the memory stream.
nulib.io.stream.rw.StreamReader, nulib.io.stream.rw.StreamWriter
A stream over a memory buffer.
MemoryStreams allow to write to a memory backed buffer, said buffer is owned by the memory stream and will grow to accomodate writes.
Ownership can be taken from a memory stream using take.
Threadsafety: Memory streams are not thread safe objects; to share them between threads you must first finish your stream operations, then take ownership of the memory; you can then copy the result out of thread-local memory.