tam1

Java-PrintWriter

PrintWriter The java.io.PrintWriter class is a subclass of java.io.Writer. PrintWriter is essentially a character-oriented version of PrintStream, that contains the familiar print( ) and println( ) methods from PrintStream. The PrintWriter class implements the abstract write() methods from java.io.Writer. The PrintWriter can send text either to an output stream or to another writer. Print and … Read more…

tam1

Java-PrintStream

PrintStream We can use print streams to output data into a file or to the console. System.out and System.err are instances of the PrintStream class. This is a subclass of FilterOutputStream that converts primitive types and objects to text. System.out is primarily used for simple, character-mode applications. All characters printed by a PrintStream are converted into bytes … Read more…

PipedOutputStream and PipedInputStream

Java-PipedOutputStream and PipedInputStream

PipedOutputStream and PipedInputStream The PipedOutputStream class and PipedInputStream class provide functionality for threads to communicate and exchange data between them. The PipedOutputStream class lets a sending thread write a stream of bytes to an instance of the PipedInputStream class, which a receiving thread uses to subsequently read those bytes, as shown in following figure : PipedOutputStream declares a … Read more…

Java-PipedWriter and PipedReader

PipedWriter and PipedReader The PipedWriter class and PipedReader class provide functionality for threads to communicate and exchange data between them. The PipedWriter class lets a sending thread write a stream of characters to an instance of the PipedReader class, which a receiving thread uses to subsequently read those characters, as shown in following figure : PipedWriter declares a void connect(PipedReader … Read more…

Java-OutputStreamWriter and InputStreamReader

Java-OutputStreamWriter and InputStreamReader

OutputStreamWriter An OutputStreamWriter is a bridge from character streams to byte streams: Characters written to it are encoded into bytes using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform’s default charset may be accepted. Each invocation of a write() method causes the … Read more…

PushbackInputStream

Java-PushbackInputStream

PushbackInputStream The PushbackInputStream can be used to push a single or multiple bytes(that was previously read) back into the input stream so that it can be reread. This is useful in situations where it is convenient for a fragment of code to read an indefinite number of data bytes that are delimited by a particular byte … Read more…