Which of the following methods is used to read data from an InputStream object connected to a socket?

  • read()
  • readData()
  • readFromSocket()
  • readStream()
To read data from an InputStream object connected to a socket, you typically use the read() method. This method reads a single byte of data and returns an integer representation of that byte. You can then cast it to the appropriate data type. The other options are not standard methods for reading from sockets.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *