I have some queries about sending/receiving via bluetooth to consult everyone here. I understand that when i want to send a file from the phone to pc though the serial port profile, i have to send the size of the file then the data itself. I looked through the bemused code but could not quite understand about the shift right and ANDing operation something like this:

iPacketBuf.Append(_L8(" "));
iPacketBuf[4] = (TUint8) ((aFileName.Length() >> 8) & 0xFF);
iPacketBuf[5] = (TUint8) (aFileName.Length() & 0xFF);
iSocket.Write(iPacketBuf, iStatus);

The above code is the sending of the size of the file i suppose.Can you explain to me the rationale of this code?Thanks a lot