Stronger guarantees for write block sizes
Certain output streams such as compressors and ciphers may require a certain block size on each write.
This commit is contained in:
parent
2bc3941e76
commit
6250518b6f
1 changed files with 10 additions and 9 deletions
|
|
@ -223,6 +223,7 @@ proc writeDataAsPages(s: OutputStreamVar, data: ptr byte, dataLen: int) =
|
||||||
data = data
|
data = data
|
||||||
dataLen = dataLen
|
dataLen = dataLen
|
||||||
|
|
||||||
|
if dataLen > s.pageSize:
|
||||||
if dataLen < s.maxWriteSize:
|
if dataLen < s.maxWriteSize:
|
||||||
s.vtable.writePage(s, makeOpenArray(data, dataLen))
|
s.vtable.writePage(s, makeOpenArray(data, dataLen))
|
||||||
s.endPos += dataLen
|
s.endPos += dataLen
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue