You choose an input stream when you want to bring bytes into your program. As with Readers, you decide where you want to read from, and choose one of the InputStream classes accordingly (see Table 17-7).
Table 17-7. Choose the InputStream class based on the source of the input
As before, you connect to socket and URL input streams using a method call, rather than a constructor. The method
getInputStream() returns an input stream connected to the network resource, as shown in Table 17-8.
Table 17-8. Choose the
getInputStream() method based on the source of the data
Read input from