Implement readInto and read(n)

This commit is contained in:
Zahary Karadjov 2020-05-01 21:39:08 +03:00
commit bf930b6f1b
No known key found for this signature in database
GPG key ID: C8936F8A3073D609
12 changed files with 636 additions and 220 deletions

View file

@ -166,11 +166,11 @@ suite "output stream":
fileStream.write delayedWriteContent
streamWritingToExistingBuffer.write delayedWriteContent
var totalBytesWritten = 0
var bytesWritten = 0
for i, count in [2]: # 12, 342, 2121, 23, 1, 34012, 932]:
output repeat(byte(i), count)
totalBytesWritten += count
check memStream.pos - cursorStart == totalBytesWritten
bytesWritten += count
check memStream.pos - cursorStart == bytesWritten
cursor.finalWrite delayedWriteContent