I want to send several strings from A to B using the DataInputStream.
I know how to send these across using .write()
but I'm unsure of the best method to seperate the strings. In fact - after research, it doesn't seem as if it's possible unless I add a character in the string and split at B.
Any alternatives to using the DataInputStream
would be considered. I was going to create a Array
and send that across, although I wasn't sure how to do it.
So far I have:
public String getDetails() {
System.out.print("Name: ");
String uiname = scan.next();
pout.write(uiname);
System.out.print("Address: ");
String uiaddress = scan.next();
pout.write(uiaddress);
return "";
}