Esempio n. 1
0
        void IFieldBase.Pack(Stream str)
        {
            IntegralFieldBase.WriteFieldHeader(str, FieldType.FieldList, fieldID);
            str.WriteShort((short)fields.Count);

            EncodeFields(str);
        }
Esempio n. 2
0
        public override void Pack(Stream str)
        {
            IntegralFieldBase.WriteFieldHeader(str, FieldType.Bool, FieldID);

            if (data)
            {
                str.WriteByte(1);
            }
            else
            {
                str.WriteByte(0);
            }
        }
Esempio n. 3
0
        public override void Pack(Stream str)
        {
            IntegralFieldBase.WriteFieldHeader(str, FieldType.String, fieldID);

            byte[] tempArr = StringHelper.GetBytes(data);

            if (tempArr != null)
            {
                str.WriteShort((short)tempArr.Length);
                str.Write(tempArr, 0, tempArr.Length);
            }
            else
            {
                str.WriteShort(0);
            }
        }
Esempio n. 4
0
        public override void Pack(Stream str)
        {
            IntegralFieldBase.WriteFieldHeader(str, fieldType, fieldID);

            if (isLong)
            {
                str.WriteInteger24(data.Length);
            }
            else
            {
                str.WriteShort((short)data.Length);
            }

            if ((data != null) && (data.Length > 0))
            {
                str.Write(data, 0, data.Length);
            }
        }
Esempio n. 5
0
 public override void Pack(Stream str)
 {
     IntegralFieldBase.WriteFieldHeader(str, FieldType.Int32, fieldID);
     str.WriteInteger(data);
 }
Esempio n. 6
0
 public override void Pack(Stream str)
 {
     IntegralFieldBase.WriteFieldHeader(str, FieldType.Double, fieldID);
     str.WriteLong((long)data);
 }
Esempio n. 7
0
 public override void Pack(Stream str)
 {
     IntegralFieldBase.WriteFieldHeader(str, FieldType.DateTime, FieldID);
     str.WriteLong(Data.ToFileTime());
 }
Esempio n. 8
0
 public override void Pack(Stream str)
 {
     IntegralFieldBase.WriteFieldHeader(str, FieldType.Byte, FieldID);
     str.WriteByte(Data);
 }