Module: Rumai::IXP::Stream

Included in:
IO, StringIO
Defined in:
lib/rumai/ixp/message.rb

Overview

A 9P2000 byte stream.

Constant Summary

PACKING_FLAGS =

uchar, ushort, uint32 (all of them little-endian)

{ 1 => 'C', 2 => 'v', 4 => 'V' }.freeze

Instance Method Summary (collapse)

Instance Method Details

- (Object) read_9p(num_bytes)

Unpacks the given number of bytes from this 9P2000 byte stream.



31
32
33
# File 'lib/rumai/ixp/message.rb', line 31

def read_9p num_bytes
  read(num_bytes).unpack(PACKING_FLAGS[num_bytes])[0]
end