mirror of https://github.com/deavmi/river
Tristan B. Velloza Kildaire
62d77adc80
- Removed FIXME which was actually an error in how we were testing and NOT `writeFully(byte[])` itself - Removed completed TODO for `writeFully(byte[])` |
||
---|---|---|
.github/workflows | ||
branding | ||
source/river | ||
.gitignore | ||
README.md | ||
dub.json |
README.md
River
River provides a base interface describing a so-called "stream" interface, this entails the following methods:
read(byte[] buff)
- Reads into the provided buffer,
buff
, at most the number of bytes equal to the length ofbuff
and at least 1 byte - On any error a
StreamException
is thrown
- Reads into the provided buffer,
readFully(byte[] buff)
- Similar to
read(byte[])
except it will block until the number of bytes read is exactly equal to the length ofbuff
- On any error a
StreamException
is thrown
- Similar to
write(byte[] buff)
- Writes from the provided buffer,
buff
, at most the number of bytes equal to the length ofbuff
and at least 1 byte - On any error a
StreamException
is thrown
- Writes from the provided buffer,
writeFully(byte[] buff)
- Similar to
write(byte[])
except it will block until the number of bytes written is exactly equal to the length ofbuff
- On any error a
StreamException
is thrown
- Similar to
close()
- Closes the stream
- On any error a
StreamException
is thrown
Checkout the Streams API.
Implementations
To go along with the streams API we also offer a few implementations of useful stream-types which you can use right away (or extend) within your application, these include:
- SockStream
- Provides a streamable access to a
Socket
- Note, only works with
SocketType.STREAM
- Provides a streamable access to a
- PipeStream
- Provides a streamable access to a pipe pair of file descriptors
- Note, only supports POSIX-like systems to far
... see the rest;