PushbackInputStream example program in Java
One of the novel uses of buffering is the implementation of pushback. Pushback is used on an input stream to allow a byte to be read and then returned (that is, "pushed back") to t
Read tutorialTHE TUTORIAL LIBRARY
One of the novel uses of buffering is the implementation of pushback. Pushback is used on an input stream to allow a byte to be read and then returned (that is, "pushed back") to t
Read tutorialBuffering I/O is a very common performance optimization. Java's BufferedInputStream class allows you to "wrap" any InputStream into a buffered stream and achieve this performance i
Read tutorialByteArrayOutputStream is an implementation of an output stream that uses a byte array as the destination. ByteArrayOutputStream has two constructors, shown here:
Read tutorialByteArrayInputStream is an implementation of an input stream that uses a byte array as the source. This class has two constructors, each of which requires a byte array to provide t
Read tutorialFileOutputStream creates an OutputStream that you can use to write bytes to a file. Its most commonly used constructors are shown here:
Read tutorialThe FileInputStream class creates an InputStream that you can use to read bytes from
Read tutorialYou will often want to limit the number of files returned by the list() method to include only those files that match a certain filename pattern, or filter. To do this, you must us
Read tutorialA directory is a File that contains a list of other files and directories. When you create a File object and it is a directory, the isDirectory() method will return true. In this c
Read tutorialAlthough most of the classes defined by java.io operate on streams, the File class does not. It deals directly with files and the file system. That is, the File class does not spec
Read tutorialThe Random class is a generator of pseudorandom numbers. These are called pseudorandom numbers because they are simply uniformly distributed sequences. Random defines the following
Read tutorialThe abstract Calendar class provides a set of methods that allows you to convert a time in milliseconds to a number of useful components. Some examples of the type of information t
Read tutorialA BitSet class creates a special type of array that holds bit values. This array can increase in size as needed. This makes it similar to a vector of bits. The BitSet constructors
Read tutorialOne example today. A better developer tomorrow.