The correct implementation is to block. Attempts to try to figure out if there is enough data available will not work reliably since you don't even know how many bytes you have to look for. Streams also often don't know how much data is available because that depends on the somewhere in your operating system handled network stack and other parameters.
There is a nonblocking alternative to blocking streams in the java.nio
package which can handle multiple connections in a single thread but that's an entirely different story.