mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
minor change in binary read_fully
This commit is contained in:
parent
15f17a0bc3
commit
658af207ab
1 changed files with 7 additions and 1 deletions
|
|
@ -218,7 +218,13 @@ function io_stream:read_fully(useTable)
|
||||||
if self.binaryMode then
|
if self.binaryMode then
|
||||||
local result = useTable and Bytearray() or { }
|
local result = useTable and Bytearray() or { }
|
||||||
|
|
||||||
readFully(result, function() return self:__read(self.maxBufferSize, true) end)
|
local avail = self:available()
|
||||||
|
|
||||||
|
if avail == 0 then
|
||||||
|
avail = self.maxBufferSize
|
||||||
|
end
|
||||||
|
|
||||||
|
readFully(result, function() return self:__read(avail, true) end)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue