Namespace Neon.IO
Classes
BlockStream
Implements an in-memory stream based on a collection of Block buffers rather than a single byte buffer. This is more efficient than MemoryStream for large streams and also avoids allocations in the large object heap.
FixedLengthStream
Implements a specialized stream that wraps another stream that does not support seeking such that the Length property will return a specific value.
This is useful for situations such as a web request handler that needs to process the body stream which does not implement Length but where this length is required.
To use, simply construct an instance, passing the source stream and its length (often obtained via an HTTP Content-Length header.
note
This stream is really intended just for reading data and does not support:
- writing
- seeking
- setting the length
LinuxPath
Implements functionality much like Path, except for this class is oriented towards handling Linux-style paths on a remote (possibly a Windows) machine.
PreprocessReader
Preprocesses text returned by a TextReader by removing comments, expanding variables, and implementing simple conditionals.
RelayStream
Implements a stream that passes operations to another stream. This is mainly useful for controlling whether Dispose() and Dispose(bool) actually disposes the underlying stream or not when the stream is referenced by another class that always disposes the stream.
StaticDirectoryBase
Helper class that can be used by IStaticDirectory implementations.
note
Implementations derived from this class will use case insensitive file and directory name mapping.
StaticFileBase
Helper class that can be used by IStaticFile implementations.
note
Implementations derived from this class will use case insensitive file and directory name mapping.
SubStream
Implements a Stream that operates on a section of a base stream. The base stream must be able to CanSeek.
note
Thread safety: multiple SubStream instances can perform operations on the same underlying stream on differents because substreams obtain a lock on the base stream before actually performing any I/O operations.
note
WARNING: Avoid performing operations on the underlying stream and any substreams within different threads. This will likey result in unexpected data corruption.
TempFile
Generates a globally unique temporary file name and then ensures that the file is removed when the instance is disposed.
TempFolder
Manages a temporary file system folder to be used for the duration of a unit test.
Structs
LinuxPermissions
Manipulates Linux style file permissions.
Interfaces
IStaticDirectory
Describes a logical file in a static file system. This is used to abstract access to static files read from an assembly's embedded resources or potentially from other sources using Linux style paths.
This is currently used to emulate a tree of IStaticDirectory and IStaticFile instances loaded from an assembly's embedded resources via the GetResourceFileSystem(Assembly, string) extension method.
note
IMPORTANT: Implementations need to be thread-safe.
note
In general, file and directory name lookup case sensitivity should probably be case insensitive for most purposes but this is an implementation specific detail.
IStaticFile
Describes a logical file in a static file system. This is used to abstract access to static files read from an assembly's embedded resources or potentially from other sources using Linux style paths.
This is currently used to emulate a tree of IStaticDirectory and IStaticFile instances loaded from an assembly's embedded resources via the GetResourceFileSystem(Assembly, string) extension method.
note
IMPORTANT: Implementations need to be thread-safe.
note
In general, file and directory name lookup case sensitivity should probably be case insensitive for most purposes but this is an implementation specific detail.
Enums
LineEnding
Enumerates the possible line ending modes.