vibe.d beta banner
get vibe.d
0.8.4

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) (
  InputStream source,
  OutputStream sink,
  ulong nbytes
) @trusted
if (isOutputStream!OutputStream && isInputStream!InputStream);

ulong pipe(InputStream, OutputStream) (
  InputStream source,
  OutputStream sink
)
if (isOutputStream!OutputStream && isInputStream!InputStream);

The number of bytes written is either the whole input stream when nbytes == 0, or exactly nbytes for nbytes > 0. 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 RejectedSoftware e.K.

License

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