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 |
If goto and const is reserve words than why it is not work in java?
What is compile time polymorphism?
20 Answers CTS, Elementus Technologies, Oracle,
Which java ide is used the most?
How thread scheduler schedule the task?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is the minimum and maximum length of an identifier?
What is the use of predicate in java 8?
What is a literal coding?
What is bitwise complement?
What are the different ways to handle exceptions?
How does singleton class work?
A person says that he compiled a java class successfully without even having a main method in it? Is it possible?