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 stringbuffer in java?
is memory to the abstract class allocated ..or objects not instantiated
what is instanceof operator used in java?
What is a class reference?
java is pure object-oriented programming language?why it is platform independent.
Which method will get invoked first in a stand alone application?
When the constructor of a class is invoked?
Where is the singleton class used?
I have a string like _a01_a02_a03_ and another string like _2_1.5_4_ as input.I want to extract a01,a02... to a string array and 2,1.5,etc to a double array with a01 corresponds to 2 and a02 to 1.5 etc. Need code in core java.. Can you do it?
How we get some middle records in one table?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is the public method modifier?