Obtain InputStream for reading from Java Socket. This is done as following:
Pretty simple, right?
Socket socket = new Socket("jenkov.com", 80);
InputStream in = socket.getInputStream();
int data = in.read();
//... read more data...
This shall be noticed that one canít read always from the InputStream of Socket till -1 is returned, as it could be done while a file