Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can you take string into InputStream?

Answers were Sorted based on User's Feedback



How can you take string into InputStream?..

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

How can you take string into InputStream?..

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

How can you take string into InputStream?..

Answer / neema

string are converted to bytes and taken to FileInputStream

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What are meta-annotations?

0 Answers   Cyient,


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

0 Answers  


How to make a read-only class in java?

0 Answers  


What are static blocks in java ?

0 Answers  


Is ruby built on java?

0 Answers  


Can java hashmap have duplicate keys?

0 Answers  


A class can be a subclass of itself?

2 Answers   Genesis,


What is type inference in java8?

0 Answers  


What is one third plus one third as a fraction?

0 Answers  


What is main in java?

0 Answers  


What is ternary operator?

0 Answers  


What is the difference between synchronized and synchronized block?

0 Answers  


Categories