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 |
Why array is used in java?
How is Object Oriented Programming different from Procedure Oriented Programming?
Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?
can we write a program with out a class in core java?
if we give input as " hi how are you" then the output should be "uoy woh"...it should skip odd words in the input and should reverse even words from the end of string...can anyone help me to write this program in java
Is singleton thread safe in java?
What for read() function?
why string constant pool in java
How is tree Mirroring implemented?
What are measurable parameters?
Difference between java and javascript
Is java still relevant?