def METHOD_NAME(self, fmt):
    fmt = self.endian + fmt
    size = struct.calcsize(fmt)
    if size > len(self.data) - self.pos:
        raise EndOfBuffer("No data in buffer for unpacking %s bytes" % size)
    cur = self.data[self.pos:self.pos + size]
    self.pos += size
    return struct.METHOD_NAME(fmt, cur)