Exemplo n.º 1
0
            public static byte[] GetBuffer(string _src)
            {
                byte[] strbyte = Encoding.UTF8.GetBytes(_src);
                byte[] lenbyte = BufferBase.GetBuffer((short)strbyte.Length);
                byte[] ret     = new byte[strbyte.Length + lenbyte.Length];

                lenbyte.CopyTo(ret, 0);
                if (strbyte.Length > 0)
                {
                    strbyte.CopyTo(ret, lenbyte.Length);
                }

                return(ret);
            }
Exemplo n.º 2
0
 public void AddString(string _src)
 {
     AddBytes(BufferBase.GetBuffer(_src));
 }
Exemplo n.º 3
0
 public void AddBool(bool _src)
 {
     AddByte(BufferBase.GetBuffer(_src));
 }
Exemplo n.º 4
0
 public void AddFloat(float _src)
 {
     AddBytes(BufferBase.GetBuffer(_src));
 }
Exemplo n.º 5
0
 public void AddLong(long _src)
 {
     AddBytes(BufferBase.GetBuffer(_src));
 }
Exemplo n.º 6
0
 public void AddInt(int _src)
 {
     AddBytes(BufferBase.GetBuffer(_src));
 }
Exemplo n.º 7
0
 public void AddShort(short _src)
 {
     AddBytes(BufferBase.GetBuffer(_src));
 }