ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1720)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (43)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (195)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (145)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
How can you take string into InputStream?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can you take string into InputStream?
Answer
# 1
string are converted to bytes and taken to FileInputStream 
Is This Answer Correct ?    0 Yes 1 No
Neema
 
  Re: How can you take string into InputStream?
Answer
# 2
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
Himanshu Gupta
 
 
 
  Re: How can you take string into InputStream?
Answer
# 3
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
Sudhakar P
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
how to create an applet   2
What is the basically use of finally while we know it is always executed but why? TCS 5
How many bits are allocated to represent character of character sets - Unicode, ASCII, UTF-16, UTF-8?   1
If set accepts only one argument then how can it compare two objects to avoid duplicates   5
if the memory capacity is 700 presently occupied by process is 690. then another process request space(40) how this situation handled in java. Wipro 4
What is a serializable interface?   4
How to print nodes of a Binary tree? TCS 1
why do we use interface in java?   5
wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?   2
What are the two major components of JDBC? Mind-Tree 5
wht is mean by dirty read?   1
What is Remote Interface ? CTS 6
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com