Java-StringReader

StringReader The StringReader class represents those character streams, whose source is a string. StringReader class extends the Reader class, which is an abstract class for reading data from character streams. StringReader Constructors Constructors Description StringReader(String s) Creates a new string reader. StringReader Methods Method Description int read() Reads a single character. int read(char[] cbuf, int off, int … Read more…

Java-StringWriter

StringWriter StringWriter class is a character stream that collects its output in a string buffer, which can then be used to construct a string. The buffer of StringWriter automatically grows according to data. Closing a StringWriter has no effect. StringWriter Constructors Constructors Description StringWriter() Create a new string writer using the default initial string-buffer size. StringWriter(int initialSize) … Read more…

Java-CharArrayReader

CharArrayReader CharArrayReader class contains an internal buffer that can be used as a character-input stream. It inherits Reader class. CharArrayReader Constructors Constructors Description CharArrayReader(char[] buf) Creates a CharArrayReader from a specified character array. CharArrayReader(char[] buf, int offset, int length) Creates a CharArrayReader from a specified part of character array. CharArrayReader Methods Method Description int read() Reads a … Read more…

Java-ByteArrayInputStream

ByteArrayInputStream ByteArrayInputStream class contains an internal buffer which is used to read byte array as stream. In this stream, the data is read from a byte array. Being a subclass of InputStream the ByteArrayInputStream also has a close( ) method. But calling the close( ) method has no effect on the ByteArrayInputStream. ByteArrayInputStream Constructors Constructors Description … Read more…