Source Code : String IO
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
String IO
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
public class StringIOApp {
public static void main(String args[]) throws IOException {
StringWriter outStream = new StringWriter();
String s = "This is a test.";
for (int i = 0; i < s.length(); ++i)
outStream.write(s.charAt(i));
System.out.println("outstream: " + outStream);
System.out.println("size: " + outStream.toString().length());
StringReader inStream;
inStream = new StringReader(outStream.toString());
int ch = 0;
StringBuffer sb = new StringBuffer("");
while ((ch = inStream.read()) != -1)
sb.append((char) ch);
s = sb.toString();
System.out.println(s.length() + " characters were read");
System.out.println("They are: " + s);
}
}
Thank with us