课程: Java: Advanced Concepts for High-Performance Development

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Understanding I/O in Java

Understanding I/O in Java

- [Instructor] Inputs and OutputStreams are a way of reading data or writing data. There are lots of different use cases for using Streams and they're used more often than you might think. Even a simple "Hello World" application uses them. When you have a System.out.println statement, that is actually using an OutputStream to print out the text. Streams are most often used for things like reading from and writing to files and taking user inputs from the console. Streams represent a flow of data, and a bit like streams of water, they can only go in one direction. OutputStreams write out data and InputStreams read in data. If you wanted to have data going two ways, you would need two separate Streams. There are two core abstract classes in the Java Streams API, InputStream and OutputStream. As these are abstract classes, you can't instantiate them directly, but they each have several concrete implementations for…

内容