All About Class StringBufferInputStream in Java



StringBufferInputStream class allows an application to create an input stream where bytes read are supplied by the contents of a String.Application can also read bytes from a byte array by using a ByteArrayInputStream. Only the low eight bits of each character in the string are used by this class.

The structure of the class StringBufferInputStream is given as:

public class java.io.StringBufferInputStream extends java.io.InputStream{
protected String buffer;//The string from which bytes are read.
protected int count;//the number of valid characters in the input stream buffer
protect int pos;//the index of the next characters to read data from specified input stream buffer.
//constructor
public StringBufferInputStream(String s);
//creates a StringBufferInputStream object to read data from specified String.
//methods:
public int available();
public int read();
public int read(byte b[],int offSet,int length);
public void reset();
public long skip(long n);
}
 
All About Class StringBufferInputStream in Java All About Class StringBufferInputStream in Java Reviewed by Animesh Chatterjee on October 11, 2018 Rating: 5

No comments:

Powered by Blogger.