MCP23S17 to Binary read..

I have an MCP23S17 hooked up.

I'm reading the input [as in Val = twochip.digitalRead();].

I need to bitread from this data.

I tried shiftin, but that only reads 8bits.

I've had a look around but can't seem to find a logical way of converting this.

How do I convert the DEC number it reads in to a BIN number that I can use?

Thanks in advance! It would be amazing and useful to have a method that deals with this directly!

Figured this out now!

It was fairly straight forward in the end..