Hi there,

I'm working with a technology where I have to make use of sockets, xml, and little endian notation. Using the pseudo-code from previous discussions on the technology and documentation I have to do the following:

String xmlMethod = "<method>.....</method>"

Socket mySocket = new Socket ("localhost", 9003)

// Get length of xmlMethod as a Byte Array in Little Endian notation

int methodLength = xmlMethod.length()
ByteArray methodLengthAsBytes = methodLength.convertToLittleEndianBytes()

// Write length to socket

mySocket.write(methodLengthAsBytes, 4)

// Write actual xml data

mySocket.write(xmlMethod, xmlMehod.length()

I'm having difficulty with the parts I've listed in bold. I need to find the length of my xmlMethod (which is fine), but I need it as a ByteArray in little endian notation in order to write it to a socket. This is following the protocol the developers of the technology have advised using.

Can you let me know if you have any advice on this?