Class: X11::Type::String8
- Inherits:
-
Object
- Object
- X11::Type::String8
- Defined in:
- lib/X11/type.rb
Class Method Summary collapse
Class Method Details
.pack(x, dpy) ⇒ Object
45 |
# File 'lib/X11/type.rb', line 45 def self.pack(x, dpy) = (x.b + "\x00"*(-x.length & 3)) |
.unpack(socket, size) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/X11/type.rb', line 47 def self.unpack(socket, size) raise "Expected size for String8" if size.nil? val = socket.read(size) unused_padding = (4 - (size % 4)) % 4 socket.read(unused_padding) val end |