hello guys i have been trying to read and write data to socket buffer i even looked into example but went in vain
here is my code (only client)
i tried to change
buf_in.read(read,0,1000); to buf_in.read(read,0,5000);
i getting an exception at the buf_in.read().please help me i am stuck
Thanks!
here is my code (only client)
Code:
try {
FTPSocket = new Socket("209.85.149.105",80);//google.com
} catch (Exception e) {
return false;
}
try {
buf_in = new BufferedReader(new InputStreamReader(FTPSocket.getInputStream()));
buf_out = new BufferedWriter(new OutputStreamWriter(FTPSocket.getOutputStream()));
} catch (Exception e) {
return false;
}
try{
buf_out.write(send,0,send.length());//send is string with "Hi"
} catch (Exception e) {
return false;
}
try{
buf_in.read(read,0,1000);//read variable is a char[]
}catch (Exception e) {
return false;
}
i tried to change
buf_in.read(read,0,1000); to buf_in.read(read,0,5000);
i getting an exception at the buf_in.read().please help me i am stuck
Thanks!