ABSTRACT

This chapter covers the input-output console in Java, how to read, write, and create files in Java, and their many properties. The java.io package provides virtually every class required for input and output in Java. Each of these streams serves as both an input source and an output destination. The stream in the java.io package supports a wide range of data types, including primitives, objects, and localized characters. The Vector class's elements() function may be used to obtain an enumeration object. The Java ByteArrayOutputStream class is used to write data into many files at once. The data in this stream is stored into a byte array, which can later be sent to other streams. The Java FilterInputStream class implements the InputStream. It has other subclasses, such as BufferedInputStream and DataInputStream, that provide extra capabilities. As a result, it is utilized less frequently on an individual basis.