![]() |
SystemEX
Lacking
Additional generic collection types missing in .net
|
A Stream wrapper around a Cache instance.
Provides sequential read/write access to a cache, including endian‑aware primitive serialization, range operations, and chunked asynchronous copy methods.
Seeking is supported only through the underlying cache.
More...
Public Member Functions | |
| CacheStream (TCache cache) | |
| Creates a new stream wrapper for the specified cache. | |
| override void | CopyTo (Stream destination, int bufferSize) |
| Copies the contents of this stream to another stream using the specified buffer size. | |
| virtual void | WriteTo (Stream stream) |
| Writes the entire cache content to another stream. | |
| override void | Flush () |
| Flushes the stream. No‑op for cache streams. | |
| override int | Read (byte[] buffer, int offset, int count) |
| Reads bytes from the cache into the specified buffer. | |
| override void | Write (byte[] buffer, int offset, int count) |
| Writes bytes from the buffer into the cache. | |
| override long | Seek (long offset, SeekOrigin origin) |
| Moves the cache position using the specified origin and offset. | |
| override void | SetLength (long value) |
| int | Write (char value) |
| int | Write (byte value) |
| int | Write (uint value, Endian endian) |
| int | Write (int value, Endian endian) |
| int | Write (short value, Endian endian) |
| int | Write (ushort value, Endian endian) |
| int | Write (long value, Endian endian) |
| int | Write (ulong value, Endian endian) |
| int | Write (float value, Endian endian) |
| int | Write (double value, Endian endian) |
| uint | ReadUInt (Endian endian) |
| int | ReadInt (Endian endian) |
| short | ReadShort (Endian endian) |
| ushort | ReadUShort (Endian endian) |
| long | ReadLong (Endian endian) |
| ulong | ReadULong (Endian endian) |
| char | ReadChar (ulong position) |
| float | ReadFloat (Endian endian) |
| double | ReadDouble (Endian endian) |
| ulong | WriteRange (byte[] data) |
| ulong | WriteRange (ulong iend, byte[] data) |
| byte?[] | ReadRange (uint count) |
| byte[] | ToArray () |
| Returns the entire cache content as a byte array. | |
| virtual Task | WriteAsync (ICache src, CancellationToken cancellationToken=default) |
| Asynchronously copies the contents of a source cache into this stream's cache using fixed‑size chunks. Supports cancellation and lock checking. | |
| virtual Task< ICache > | ReadAsync (ICache dest, CancellationToken cancellationToken=default) |
| Asynchronously reads the contents of this stream's cache into another cache using fixed‑size chunks. Supports cancellation and lock checking. | |
Properties | |
| override long | Position [get, set] |
| Gets or sets the current position within the cache. | |
| override bool | CanRead [get] |
| Indicates whether the stream supports reading. | |
| override bool | CanSeek [get] |
| Indicates whether the stream supports seeking. Always true for CacheStream<TCache>. | |
| override bool | CanWrite [get] |
| Indicates whether the stream supports writing. | |
| override long | Length [get] |
| Gets the length of the underlying cache. | |
| int | Written [get, set] |
| Gets the number of bytes written by the last write operation. | |
| ulong | LongLength [get] |
| Gets the LongLength of the underlying cache. | |
| bool | IsEmpty [get] |
A Stream wrapper around a Cache instance.
Provides sequential read/write access to a cache, including endian‑aware primitive serialization, range operations, and chunked asynchronous copy methods.
Seeking is supported only through the underlying cache.
| TCache | The cache type used as the backing store. Must derive from Cache. |
| TCache | : | Cache |
| SystemEx.IO.CacheStream< TCache >.CacheStream | ( | TCache | cache | ) |
Creates a new stream wrapper for the specified cache.
| override void SystemEx.IO.CacheStream< TCache >.CopyTo | ( | Stream | destination, |
| int | bufferSize ) |
Copies the contents of this stream to another stream using the specified buffer size.
| override void SystemEx.IO.CacheStream< TCache >.Flush | ( | ) |
Flushes the stream. No‑op for cache streams.
| override int SystemEx.IO.CacheStream< TCache >.Read | ( | byte[] | buffer, |
| int | offset, | ||
| int | count ) |
Reads bytes from the cache into the specified buffer.
|
virtual |
Asynchronously reads the contents of this stream's cache into another cache using fixed‑size chunks.
Supports cancellation and lock checking.
| char SystemEx.IO.CacheStream< TCache >.ReadChar | ( | ulong | position | ) |
| double SystemEx.IO.CacheStream< TCache >.ReadDouble | ( | Endian | endian | ) |
| float SystemEx.IO.CacheStream< TCache >.ReadFloat | ( | Endian | endian | ) |
| int SystemEx.IO.CacheStream< TCache >.ReadInt | ( | Endian | endian | ) |
| long SystemEx.IO.CacheStream< TCache >.ReadLong | ( | Endian | endian | ) |
| byte?[] SystemEx.IO.CacheStream< TCache >.ReadRange | ( | uint | count | ) |
| short SystemEx.IO.CacheStream< TCache >.ReadShort | ( | Endian | endian | ) |
| uint SystemEx.IO.CacheStream< TCache >.ReadUInt | ( | Endian | endian | ) |
| ulong SystemEx.IO.CacheStream< TCache >.ReadULong | ( | Endian | endian | ) |
| ushort SystemEx.IO.CacheStream< TCache >.ReadUShort | ( | Endian | endian | ) |
| override long SystemEx.IO.CacheStream< TCache >.Seek | ( | long | offset, |
| SeekOrigin | origin ) |
Moves the cache position using the specified origin and offset.
| override void SystemEx.IO.CacheStream< TCache >.SetLength | ( | long | value | ) |
| byte[] SystemEx.IO.CacheStream< TCache >.ToArray | ( | ) |
Returns the entire cache content as a byte array.
| int SystemEx.IO.CacheStream< TCache >.Write | ( | byte | value | ) |
| override void SystemEx.IO.CacheStream< TCache >.Write | ( | byte[] | buffer, |
| int | offset, | ||
| int | count ) |
Writes bytes from the buffer into the cache.
| int SystemEx.IO.CacheStream< TCache >.Write | ( | char | value | ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | double | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | float | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | int | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | long | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | short | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | uint | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | ulong | value, |
| Endian | endian ) |
| int SystemEx.IO.CacheStream< TCache >.Write | ( | ushort | value, |
| Endian | endian ) |
|
virtual |
Asynchronously copies the contents of a source cache into this stream's cache using fixed‑size chunks.
Supports cancellation and lock checking.
| ulong SystemEx.IO.CacheStream< TCache >.WriteRange | ( | byte[] | data | ) |
| ulong SystemEx.IO.CacheStream< TCache >.WriteRange | ( | ulong | iend, |
| byte[] | data ) |
|
virtual |
Writes the entire cache content to another stream.
|
get |
Indicates whether the stream supports reading.
|
get |
Indicates whether the stream supports seeking.
Always true for CacheStream<TCache>.
|
get |
Indicates whether the stream supports writing.
|
get |
Gets the length of the underlying cache.
|
get |
Gets the LongLength of the underlying cache.
|
getset |
Gets or sets the current position within the cache.
|
getset |
Gets the number of bytes written by the last write operation.