The purpose of InputStream and OutputStream is to complex several approaches to input and output: whether that stream is a file, a web page, or the screen shouldn't imply. All that means is that you collect data from the stream (or send learning into that stream.)
InputStream is practiced for several things that you viewed from.
OutputStream is practiced for several things that you write to.
Are you interested in learning Java from the basics! Refer to this video on Java provided by Intellipaat:
Here's some example code. It considers the InputStream instr and OutputStream osstr have previously been performed:
int i;
while ((i = instr.read()) != -1) {
osstr.write(i);
}
instr.close();
osstr.close();