Created
March 8, 2011 16:09
-
-
Save murachue/860457 to your computer and use it in GitHub Desktop.
Add convenient methods to IO class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IO | |
def readb; return self.read(1).unpack("C")[0]; end | |
def readw; return self.read(2).unpack("v")[0]; end | |
def readl; return self.read(4).unpack("V")[0]; end | |
def readbw; return self.read(2).unpack("n")[0]; end | |
def readbl; return self.read(4).unpack("N")[0]; end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment