Created
December 14, 2015 16:44
-
-
Save YuvalItzchakov/9b404a63337f35b5dc7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void GetSize(string msg) | |
{ | |
byte[] data = Encoding.ASCII.GetBytes(msg); | |
byte[] sizeinfo = new byte[4]; | |
sizeinfo[0] = (byte)data.Length; | |
sizeinfo[1] = (byte)(data.Length >> 8); | |
sizeinfo[2] = (byte)(data.Length >> 16); | |
sizeinfo[3] = (byte)(data.Length >> 24); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment