vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function pipe

Pipes an InputStream directly into this OutputStream.

ulong pipe(InputStream, OutputStream) (
  scope InputStream source,
  scope OutputStream sink,
  ulong nbytes,
  PipeMode mode = PipeMode.sequential
) @trusted
if (isOutputStream!OutputStream && isInputStream!InputStream);

ulong pipe(InputStream, OutputStream) (
  scope InputStream source,
  scope OutputStream sink,
  ulong nbytes,
  PipeConfig config
) @trusted
if (isOutputStream!OutputStream && isInputStream!InputStream);

ulong pipe(InputStream, OutputStream) (
  scope InputStream source,
  scope OutputStream sink,
  PipeMode mode = PipeMode.sequential
)
if (isOutputStream!OutputStream && isInputStream!InputStream);

The number of bytes written is either the whole input stream when nbytes == ulong.max, or exactly nbytes for nbytes < ulong.max. If the input stream contains less than nbytes of data, an exception is thrown.

Returns

The actual number of bytes written is returned. If nbytes is given and not equal to ulong.max, íts value will be returned.

Authors

Sönke Ludwig

Copyright

© 2012-2016 Sönke Ludwig

License

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