Class: String
Overview
Class Method Summary collapse
-
.from_9p(stream) ⇒ Object
Creates a new instance of this class from the given 9P2000 byte stream and returns the instance.
Instance Method Summary collapse
-
#byteslice(*args) ⇒ Object
Does the same thing as String#slice but operates on bytes instead of characters.
-
#to_9p ⇒ Object
Transforms this object into a string of 9P2000 bytes.
Class Method Details
.from_9p(stream) ⇒ Object
Creates a new instance of this class from the given 9P2000 byte stream and returns the instance.
694 695 696 |
# File 'lib/rumai/ixp/message.rb', line 694 def self.from_9p stream stream.read stream.read_9p(2) end |
Instance Method Details
#byteslice(*args) ⇒ Object
Does the same thing as String#slice but operates on bytes instead of characters.
703 704 705 |
# File 'lib/rumai/ixp/message.rb', line 703 def byteslice(*args) unpack('C*').slice(*args).pack('C*') end |