G
Guest
I have two byte arrays and a char (the letter S) I was to concatenate to one byte array. Here is what code I have.
I basically want to send this in a one buffer (byte array?) through a socket.
SWXXXXXXXXXYYYYZZZZZZZZZZZZZZZZZZZZZ
Where S is the command for SEND and should just be the character S.
Where W is a byte representing how long the filename (testfile.txt) is. In this case 12.
Where XXXXXXX is converted from a string that holds the filename(testfile.txt).
Where YYYY is four bytes representing the number of bytes in ZZZZZ etc. 64,0,0,0 in this case.
Where ZZZZZ etc is the actual file (testfile.txt) in bytes.
My overall byte array is TxBuffer.
byte[] byteFileNameLength // byte array that holds size of file name
string pstrFileName // string that contains the FileName
byte[] byteFileSizeLength // byte array that holds size of file
TxBuffer[0] = (byte)'S';
Is there an easy way to fill in the TxBuffer[1 to whatever]?
TIA,
Nate
I basically want to send this in a one buffer (byte array?) through a socket.
SWXXXXXXXXXYYYYZZZZZZZZZZZZZZZZZZZZZ
Where S is the command for SEND and should just be the character S.
Where W is a byte representing how long the filename (testfile.txt) is. In this case 12.
Where XXXXXXX is converted from a string that holds the filename(testfile.txt).
Where YYYY is four bytes representing the number of bytes in ZZZZZ etc. 64,0,0,0 in this case.
Where ZZZZZ etc is the actual file (testfile.txt) in bytes.
My overall byte array is TxBuffer.
byte[] byteFileNameLength // byte array that holds size of file name
string pstrFileName // string that contains the FileName
byte[] byteFileSizeLength // byte array that holds size of file
TxBuffer[0] = (byte)'S';
Is there an easy way to fill in the TxBuffer[1 to whatever]?
TIA,
Nate