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 purpose of declaring a variable as final?
does java support pointers?
Difference between vector and arraylist.
Is the milky way in a void?
After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?
How do you declare an array in java?
What is default specifier ??? Use of default specifier ???
Difference between hashCode() & equals()?
What does escaping a character mean?
what is difference between String buffer and String builder?
what is d difference between deep cloning and shallow cloning in core java?
What is the Layout for ToolBar?