Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Hamish Jones   on Jun 12 In Java Category.

  
Question Answered By: Alfonso Martin   on Jun 12

U can get Socket's InputStream & read byte-by-byte... i hv attached the portion
to read byte-by-byte & to print on screent... i hope u can make it other
portions, if u can't do reply i will give u the complete programs..

BufferedInputStream bin = new BufferedInputStream(s.getInputStream());
int n=-1;
byte[] b = new byte[5000];
while((n=bin.read(b,0,b.length))!=-1)
{
for(int i=0;i<n;i++)
{
System.out.print((char)b[i]);
}
}
bin.close();
s.close();

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Sockets programming Or get search suggestion and latest updates.


Tagged: