vibe.stream.operations

High level stream manipulation functions.

Public Imports

vibe.core.stream
public import vibe.core.stream;
Undocumented in source.

Members

Functions

pipeRealtime
void pipeRealtime(OutputStream destination, ConnectionStream source, ulong nbytes, Duration max_latency)

Pipes a stream to another while keeping the latency within the specified threshold.

readAll
ubyte[] readAll(InputStream stream, size_t max_bytes, size_t reserve_bytes)

Reads the complete contents of a stream, optionally limited by max_bytes.

readAllUTF8
string readAllUTF8(InputStream stream, bool sanitize, size_t max_bytes)

Reads the complete contents of a stream, assuming UTF-8 encoding.

readLine
ubyte[] readLine(InputStream stream, size_t max_bytes, string linesep, IAllocator alloc)
void readLine(InputStream stream, OutputStream dst, size_t max_bytes, string linesep)
void readLine(InputStream stream, R dst, size_t max_bytes, string linesep)

Reads and returns a single line from the stream.

readUntil
ubyte[] readUntil(InputStream stream, ubyte[] end_marker, size_t max_bytes, IAllocator alloc)
void readUntil(InputStream stream, OutputStream dst, ubyte[] end_marker, ulong max_bytes)
void readUntil(InputStream stream, R dst, ubyte[] end_marker, ulong max_bytes)

Reads all data of a stream until the specified end marker is detected.

skipBytes
bool skipBytes(InputStream stream, const(ubyte)[] bytes)

Consumes bytes.length bytes of the stream and determines if the contents match up.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig