private void writeInt32(byte[] buffer, ref int offset, object value)
 {
     offset = this.writeBytes(buffer, offset, Encoder.encodeSInt32(value.ToString()));
 }
        private byte[] encodeTag(string type, int tag)
        {
            int num = this.util.containType(type);

            return(Encoder.encodeUInt32((uint)(tag << 3 | num)));
        }
Exemple #3
0
 public static byte[] encodeUInt32(string n)
 {
     return(Encoder.encodeUInt32(Convert.ToUInt32(n)));
 }
 private void writeFloat(byte[] buffer, ref int offset, object value)
 {
     this.writeBytes(buffer, offset, Encoder.encodeFloat(float.Parse(value.ToString())));
     offset += 4;
 }
Exemple #5
0
 //Encode Int32
 private void writeInt32(byte[] buffer, ref int offset, JsonNode value)
 {
     offset = writeBytes(buffer, offset, Encoder.encodeSInt32(value.ToString()));
 }
Exemple #6
0
 public static byte[] encodeSInt32(int n)
 {
     return(Encoder.encodeUInt32(n < 0 ? (uint)(Math.Abs(n) * 2 - 1) : (uint)(n * 2)));
 }
        // Encode tag.
        private byte[] EncodeTag(string type, int tag)
        {
            int flag = this.util.ContainType(type);

            return(Encoder.EncodeUInt32((uint)(tag << 3 | flag)));
        }
Exemple #8
0
 ////Encode UInt32.
 private void writeUInt32(byte[] buffer, ref int offset, IJsonNode value)
 {
     offset = writeBytes(buffer, offset, Encoder.encodeUInt32((uint)value.AsInt()));
 }
Exemple #9
0
 //Encode float.
 private void writeFloat(byte[] buffer, ref int offset, IJsonNode value)
 {
     this.writeBytes(buffer, offset, Encoder.encodeFloat((float)value.AsDouble()));
     offset += 4;
 }
 private void writeUInt64(byte[] buffer, ref int offset, object value)
 {
     offset = writeBytes(buffer, offset, Encoder.encodeUInt64(value.ToString()));
 }
 private void writeBool(byte[] buffer, ref int offset, object value)
 {
     offset = writeBytes(buffer, offset, Encoder.encodeBool(value));
 }