private static void EncodeString(String input, MemoryStream byteArrayOutPutStream)
        {
            VarInt.PutVarInt(input.Length, byteArrayOutPutStream);
            var inpBytes = Encoding.UTF8.GetBytes(input);

            byteArrayOutPutStream.Write(inpBytes, 0, inpBytes.Length);
        }
Exemplo n.º 2
0
        private static void PutVarInt(int input, MemoryStream byteArrayDataOutput)
        {
            var output = new byte[VarInt.VarIntSize(input)];

            VarInt.PutVarInt(input, output, 0);
            byteArrayDataOutput.Write(output, 0, output.Length);
        }
Exemplo n.º 3
0
#pragma warning disable SA1204 // Static elements must appear before instance elements
        private static void EncodeString(string input, MemoryStream byteArrayOutPutStream)
#pragma warning restore SA1204 // Static elements must appear before instance elements
        {
            VarInt.PutVarInt(input.Length, byteArrayOutPutStream);
            var inpBytes = Encoding.UTF8.GetBytes(input);

            byteArrayOutPutStream.Write(inpBytes, 0, inpBytes.Length);
        }
Exemplo n.º 4
0
        private static void EncodeString(String input, MemoryStream output)
        {
            int length = input.Length;

            byte[] bytes = new byte[VarInt.VarIntSize(length)];
            VarInt.PutVarInt(length, bytes, 0);
            output.Write(bytes, 0, bytes.Length);
            byte[] inPutBytes = Encoding.UTF8.GetBytes(input);
            output.Write(inPutBytes, 0, inPutBytes.Length);
        }