How can you take string into InputStream?
Answers were Sorted based on User's Feedback
Answer / sudhakar p
Step 1: Convert String to byte array
Step 2: Create a ByteArrayInputStream passing bytes[] to to
the contructor
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / himanshu gupta
String str="";
int i=0
InputStream in=new FileInputStream("File url");
while((i=in.read())!=-1)
{
str=str+(char)i;
}
System.out.println(str);
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the difference between length and length() method in java?
What is the purpose of using break in each case of switch statement?
what is the use/perpose of having a method antive?
What is jee6?
Need to use public,static keywords in main function?
Can we have multiple public classes in a java source file?
What is meant by class loader? How many types are there?
What is difference between float and double?
Hi friends i want display Triangle shap stars(*) please can tell me any one java code logic? * *** ***** ******* Like this
Difference between start() and run() method of thread class?
I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
What is meant by collection in java?