Add stream avail() methods

Makes it more readable to write code that needs to know how much
data/space is available in a stream.
This commit is contained in:
Pierre Ossman
2020-05-19 20:45:22 +02:00
committed by Lauri Kasanen
parent 910fd8fa3e
commit 7f90205cf2
13 changed files with 38 additions and 22 deletions

View File

@@ -101,7 +101,7 @@ size_t TLSOutStream::overrun(size_t itemSize, size_t nItems)
flush();
size_t nAvail;
nAvail = (end - ptr) / itemSize;
nAvail = avail() / itemSize;
if (nAvail < nItems)
return nAvail;