I/O Subsystem
Stream, File, Directory, BinaryReader, Compression, Hashing, and IsolatedStorage.
System::IO::Stream
include/System/IO/Stream.hpp | src/System/IO/Stream.cpp
Abstract base class for all streams. Status: Partial
| Method | Description |
|---|---|
Read(buffer, offset, count) | Pure virtual. Read bytes into buffer. |
Close() | Close the stream. |
Length | Stream length in bytes (property). |
Position | Current position (property). |
Seek(offset, origin) | Set position relative to origin. |
Concrete Stream Types
| Class | Header | Description |
|---|---|---|
FileStream | System/IO/FileStream.hpp | File-backed stream. Read, Write, Seek. |
MemoryStream | System/IO/MemoryStream.hpp | In-memory byte buffer stream. |
BufferedStream | System/IO/BufferedStream.hpp | Buffered wrapper around another stream. |
IO::Compression::GZipStream | System/IO/Compression/GZipStream.hpp | gzip compression/decompression (ZLIB, PIMPL, 64KB buffers). |
IO::Compression::DeflateStream | System/IO/Compression/DeflateStream.hpp | Raw DEFLATE stream (-MAX_WBITS), XNB-compatible. |
IsolatedStorage::IsolatedStorageFileStream | System/IO/IsolatedStorage/IsolatedStorageFileStream.hpp | File stream within isolated storage. |
Text Readers and Writers
| Class | Header | Description |
|---|---|---|
TextReader | System/IO/TextReader.hpp | Abstract text reader |
TextWriter | System/IO/TextWriter.hpp | Abstract text writer |
StreamReader | System/IO/StreamReader.hpp | Reads text from a stream |
StreamWriter | System/IO/StreamWriter.hpp | Writes text to a stream |
StringReader | System/IO/StringReader.hpp | Reads from a string |
StringWriter | System/IO/StringWriter.hpp | Writes to a string |
Binary I/O
| Class | Header | Description |
|---|---|---|
BinaryReader | System/IO/BinaryReader.hpp | Reads primitive types from a stream in binary format |
BinaryWriter | System/IO/BinaryWriter.hpp | Writes primitive types to a stream in binary format |
File and Directory
| Class | Header | Key Methods |
|---|---|---|
File | System/IO/File.hpp | ReadAllBytes, WriteAllBytes, ReadAllText, WriteAllText, Exists, Delete, Copy, Move |
Directory | System/IO/Directory.hpp | Exists, Create, Delete, GetFiles, GetDirectories, GetCurrentDirectory |
Path | System/IO/Path.hpp | Combine, GetFileName, GetExtension, GetDirectoryName, GetFullPath |
FileInfo | System/IO/FileInfo.hpp | File metadata and operations |
DirectoryInfo | System/IO/DirectoryInfo.hpp | Directory metadata and operations |
DriveInfo | System/IO/DriveInfo.hpp | Drive information |
Compression
include/System/IO/Compression/
| Class | Status | Description |
|---|---|---|
GZipStream | Done | gzip; backed by ZLIB; PIMPL; 64KB buffers |
DeflateStream | Done | Raw DEFLATE; -MAX_WBITS; XNB-compatible |
ZipArchive | Done | ZIP read+create; backed by miniz; PIMPL |
CompressionMode | Done | Compress / Decompress enum |
Hashing
include/System/IO/Hashing/
| Class | Status | Description |
|---|---|---|
XxHash32 | Done | xxHash 32-bit non-cryptographic hash |
XxHash64 | Done | xxHash 64-bit non-cryptographic hash |
Crc32 | Done | CRC-32 non-cryptographic hash |
NonCryptographicHashAlgorithm | Done | Base class |
RandomAccess
include/System/IO/RandomAccess.hpp | src/System/IO/RandomAccess.cpp
Status: Done — but POSIX-only on Linux/macOS.
Uses pread/pwrite/fsync on POSIX, and Win32 OVERLAPPED ReadFile/WriteFile on Windows. Emscripten throws PlatformNotSupportedException.
IsolatedStorage
include/System/IO/IsolatedStorage/
Provides sandboxed file storage. The storage root is determined by SharpRuntime::Storage::StoragePaths::GetIsolatedStorageRoot().
| Class | Status |
|---|---|
IsolatedStorageFile | Partial |
IsolatedStorageFileStream | Partial |
IsolatedStorageException | Done |
Platform Notes
⚠ POSIX-only subsystems
System::IO::RandomAccess— usespread/pwrite; POSIX-only (has Win32 fallback)- Network streams — see Platform Layer