What you describe will certainly work. On the receiving end you would need
to cast your strings and integers as they are digested. Depending on how
clever you are, though, you might have to pair the sender and receiver.
However, have you considered using XML? You could create a general purpose
tool to send arbitrary sets of variables with their values. Using schema,
you can even type them on the sending side.
Dave


-----Original Message-----
From: Gardner Monte [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 27, 2001 4:02 PM
To: [EMAIL PROTECTED]
Subject: DataOutputStream


I'm planning a series of communications between a Java
Application, and a Java Servlet.  The client needs to
send a integer, then two different strings to the Servlet.
What I'm thinking of doing is using dataInputStreams and
DataOutputStreams and their corresponding writeInt, and
writeChars methods.  However, I don't think the dataInput
stream on the server side will be able to automatically
detect where one string ends and another begins, so I'm thinking
of putting some standard delimeter between the strings, and
then using StringTokenizer to split them back up once
they arrive at the server.  Will this work, or is there
a better way to send a combination of integers and Strings
between two applications?


--Monte Glenn Gardner

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to