Class: Mu::Pcap::IOPair::Stream
- Inherits:
-
Mu::Pcap::IOPair
- Object
- Mu::Pcap::IOPair
- Mu::Pcap::IOPair::Stream
- Defined in:
- lib/mu/pcap/io_pair.rb
Instance Attribute Summary
Attributes inherited from Mu::Pcap::IOPair
Instance Method Summary collapse
-
#initialize ⇒ Stream
constructor
A new instance of Stream.
- #read(n = nil) ⇒ Object
Methods inherited from Mu::Pcap::IOPair
packet_pair, stream_pair, #write
Constructor Details
#initialize ⇒ Stream
Returns a new instance of Stream.
44 45 46 |
# File 'lib/mu/pcap/io_pair.rb', line 44 def initialize @read_queue = "" end |
Instance Method Details
#read(n = nil) ⇒ Object
48 49 50 51 |
# File 'lib/mu/pcap/io_pair.rb', line 48 def read n=nil n ||= @read_queue.size @read_queue.slice!(0,n) end |