To use this package, put the following dependency into your project's dependencies section:
About this library
This library intends to provide streams that are similar to the streams you find in .Net, simply because I miss them when coding in D.
I'd like to note that this library makes use of exceptions for most of it's error handling.
The memory stream, as the name implies, is a stream that writes directly into memory (as opposed to a file or socket).
This stream has support for
std.experimental.allocator, so the programmer can decide how it allocates memory.
This stream doesn't use the GC except for exceptions, or if the given allocator uses it.
The file stream is self explanitory.
This stream doesn't use the GC except for exceptions, or if
std.stdio.File uses it.
This is a helper class that can wrap around any
Stream object to provide an easy way to turn primitive types and arrays of primitive types
It should be noted that the initial code was stolen from my other library, which was designed so that all numeric types are written out in big endian. In the near future I plan on making the endianess customisable.
This module provides functions to make streams work as ranges, as well as specific range functions useful for streams.
This function will use a given
std.experimental.allocator Allocator to allocate a buffer of a specified size.
An input range is then returned which can use this buffer to provide chunks of a
Stream's data at a time.
I intend to implement the following streams:
NetworkStream (might call it SocketStream)
At some point I will probably also write a helper class akin to BinaryIO, to work with the various strings D has for when writing text data.
I'm considering marking all of
Stream's functions as
@safe, forcing implementors to make sure their code is also
This has it's own set of issues though, so it'll require some thought before I come to a decision.
There's no real examples at the moment, but both the MemoryStream and BinaryIO classes have a unittest going over most of it's functionality. Though, these are more for testing rather than a documented example of how to use the classes.
- Registered by SealabJaster
- 0.1.0 released 11 days ago
- Copyright © 2019, Sealab