Sha256: 624d1b3e8cfd7a7d240b7d1eb6519f5ee249b4b78cd295beb44eb61df4e34f56
Contents?: true
Size: 587 Bytes
Versions: 13
Compression:
Stored size: 587 Bytes
Contents
module WebSocket class Driver class Hybi class StreamReader def initialize @buffer = Driver.encode('', :binary) end def put(string) return unless string and string.bytesize > 0 @buffer << Driver.encode(string, :binary) end def read(length) buffer_size = @buffer.bytesize return nil if length > buffer_size chunk = @buffer.byteslice(0, length) @buffer = @buffer.byteslice(length, buffer_size - length) chunk end end end end end
Version data entries
13 entries across 13 versions & 2 rubygems