Null Pointer Exception with Arduino Communication

Thank you! I put that into my program and it seems to be working correctly in getting the number of characters. The only thing is, I am not sure how I am going to apply this to my code with my servos and motors? The main thing I wanted to do with the Serial ports is to send a code that the Arduino would decode and apply to the motors and servos. Perhaps I could do this with bytes, but how feasible would this be?