Which is fine, but what of the other read methods such as sys::InStream.readU4? The docs say:
Throw IOErr on error or if the end of stream is reached before four bytes can be read.
But say nothing about blocking until the 4 bytes are available?
I guess I'm asking if:
in.readBufFully(null, 4).readU4
which read 4 bytes (blocking if unavailable) into a Buf is the same as
in.readU4
brianSun 4 Aug 2013
Pretty much everything is blocking if the stream isn't closed and no bytes are available. Low level reads like read return null when at end of stream, but data reads that expect multiple bytes like readU4 raise exception when 4 bytes aren't available before end of stream. But they do block until those bytes are available.
SlimerDudeSun 4 Aug 2013
Thanks.
I guess I was looking for clarification about what end of stream meant, either
SlimerDude Sun 4 Aug 2013
sys::InStream.readBufFully
says:Which is fine, but what of the other read methods such as
sys::InStream.readU4
? The docs say:But say nothing about blocking until the 4 bytes are available?
I guess I'm asking if:
which read 4 bytes (blocking if unavailable) into a Buf is the same as
brian Sun 4 Aug 2013
Pretty much everything is blocking if the stream isn't closed and no bytes are available. Low level reads like
read
return null when at end of stream, but data reads that expect multiple bytes like readU4 raise exception when 4 bytes aren't available before end of stream. But they do block until those bytes are available.SlimerDude Sun 4 Aug 2013
Thanks.
I guess I was looking for clarification about what
end of stream
meant, eitherCheers.
brian Sun 4 Aug 2013
It means stream closed