Java Socket NIO Reading Issue

(code in comments)
I have a server and a client. I am trying to transmit a long from the server to the client (or reverse, neither works). I can tell it is transmitting, but the reciever gets hung up on the socket.read(buf) line in readLong. Please help. I just started NIO this morning and have no clue if I'm doing it right.
Was this page helpful?