Sha256: 36593904df2bb66cf48e13a04f2a52424d276c09b9757d3d0e2d162dea530f83
Contents?: true
Size: 481 Bytes
Versions: 123
Compression:
Stored size: 481 Bytes
Contents
class IO def read_available_bytes(chunk_size = 16384, select_timeout = 0.02) buffer = [] return "" if closed? || eof? # IO.select cannot be used here due to the fact that it # just does not work on windows while true begin IO.select([self], nil, nil, select_timeout) break if eof? # stop raising :-( buffer << self.readpartial(chunk_size) rescue(EOFError) break end end return buffer.join end end
Version data entries
123 entries across 123 versions & 9 rubygems