https://docs.oracle.com/javase/8/docs/api/java/net/Socket.html#getInputStream--
public InputStream getInputStream()
throws IOException
Returns an input stream for this socket.
If this socket has an associated channel then the resulting input stream delegates all of its operations to the channel. If the channel is in non-blocking mode then the input stream's read operations will throw an IllegalBlockingModeException.