The use of getInputStream method and getOutputStream method of Socket class

use on the client

1. The getInputStream method can get an input stream. The getInputStream method on the client's Socket object gets the input stream, which is actually the data sent back from the server.

2. The getOutputStream method obtains an output stream. The output stream obtained by the getOutputStream method on the client's Socket object is actually the data sent to the server.

Use on the server side

1. The getInputStream method obtains an input stream. The input stream obtained by the getInputStream method on the Socket object of the server is actually the data stream sent from the client to the server.

2. The getOutputStream method obtains an output stream. The output stream obtained by the getOutputStream method on the Socket object of the server is actually the data sent to the client.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324944471&siteId=291194637