How to send and receive byte array through socket connection -
02-05-2009, 04:07 AM
Hi all,
I need to send an array of byte to other machine and the other side will retrive the array of byte through socket connection. How can I do that? Thank you very much..
Below is the code that I wrote for send the byte array. The bold part is where it writes into DataOutputStream and send it out. However I dont know how to read the array byte on the other side. Thank you very much.
It seems to outline how to read and write to a socket. The reading should be as easy as creating a server socket and listening on the port you expect and then waiting for data. There are different ways to do it depending on if you want to try using NIO.
It seems to outline how to read and write to a socket. The reading should be as easy as creating a server socket and listening on the port you expect and then waiting for data. There are different ways to do it depending on if you want to try using NIO.
Thank you for the suggestions....I'v successfully implemented it..Anyway, I got another question to ask, is that possible for j2me to implement the getDeclaredFields() as in j2se?
I need to get the list of fields that declared in a particular class in j2me..How can I do it??It is urgent, thanks for the help.
Thank you for the suggestions....I'v successfully implemented it..Anyway, I got another question to ask, is that possible for j2me to implement the getDeclaredFields() as in j2se?
I need to get the list of fields that declared in a particular class in j2me..How can I do it??It is urgent, thanks for the help.
actually<i never get touch with this part b4
but i found that the codeeis need a littele modification
can u simply wait for me
i hope u find my code useful
The Following User Says Thank You to samra For This Useful Post: