Esempio n. 1
0
        public byte[] GetBytes()
        {
            byte[] data = new byte[ContentLength + 2 + 1];

            byte[] headerBytes = Base64Encoding.EncodeuUInt32(ID, 2);
            data[0] = headerBytes[0];
            data[1] = headerBytes[1];

            for (int i = 0; i < ContentLength; i++)
            {
                data[i + 2] = _content[i];
            }

            data[data.Length - 1] = 1;

            return(data);
        }
Esempio n. 2
0
        internal byte[] GetBytes()
        {
            byte[] Data = new byte[contentLength + 2 + 1];

            byte[] Header = Base64Encoding.EncodeuUInt32(this.fID, 2);
            Data[0] = Header[0];
            Data[1] = Header[1];

            for (int i = 0; i < this.contentLength; i++)
            {
                Data[i + 2] = fContent[i];
            }

            Data[Data.Length - 1] = 1;

            return(Data);
        }
Esempio n. 3
0
 /// <summary>
 ///   Gets the header of this message, by Base64 encoding the message ID to a 2 byte string.
 /// </summary>
 public string GetHeader()
 {
     return(CoreManager.ServerCore.GetTextEncoding().GetString(Base64Encoding.EncodeuUInt32(_id, 2)));
 }