Class: Mu::Pcap::IOPair::Stream

Inherits:
Mu::Pcap::IOPair show all
Defined in:
lib/mu/pcap/io_pair.rb

Instance Attribute Summary

Attributes inherited from Mu::Pcap::IOPair

#other, #read_queue

Instance Method Summary collapse

Methods inherited from Mu::Pcap::IOPair

packet_pair, stream_pair, #write

Constructor Details

#initializeStream

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