I was doing a program for my friends and me so we can chat and send file's to each other BUT I find something that maked me confused. That was when I was making the last stage of the program, combining the chat and file functions. But I didn't know HOW to combine this two. Because the chat have one input stream and one output BUT the file function GOT THREE streams:
fis = new FileInputStream(myFile);
bis = new BufferedInputStream(fis);
os = sock.getOutputStream();
And this is the chat function streams:
outputdata = new ObjectOutputStream(connect.getOutputStream());
inputdata = new ObjectInputStream(connect.getInputStream());
So how should I combine this programs, if this is too little information here's a short explanation: I want to do a chat AND file transfer program with Java socket but how should I do so the streams are correct so it know when it ONLY should send text or when it ONLY should send file's.
Thanks for and answer :D!