Sha256: 50b8663ff2681ca778ea63f8096efdb46a424cbfac1599a6461916b8c2322391

Contents?: true

Size: 481 Bytes

Versions: 15

Compression:

Stored size: 481 Bytes

Contents

module Faye
  class WebSocket
    class HybiParser

      class StreamReader
        def initialize
          @queue = []
        end

        def read(length)
          read_bytes(length)
        end

        def put(bytes)
          return unless bytes and bytes.size > 0
          @queue.concat(bytes)
        end

      private

        def read_bytes(length)
          return nil if length > @queue.size
          @queue.shift(length)
        end
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
faye-websocket-0.4.7-java lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.7 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.6-java lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.6 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.5-java lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.5 lib/faye/websocket/hybi_parser/stream_reader.rb
_bushido-faye-websocket-0.4.4 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.4-java lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.4 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.3 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.2 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.1 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.4.0 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.3.0 lib/faye/websocket/hybi_parser/stream_reader.rb
faye-websocket-0.2.0 lib/faye/websocket/hybi_parser/stream_reader.rb