Exemplo n.º 1
0
 public int Write(byte[] !buffer, ref int offset)
 {
     offset += LabelEncoding.PutBytes(Name, buffer, offset);
     offset += NetworkBitConverter.PutBytes((ushort)Type,
                                            buffer, offset);
     offset += NetworkBitConverter.PutBytes((ushort)Class,
                                            buffer, offset);
     return(offset);
 }
Exemplo n.º 2
0
        public int Write(byte [] !buffer, ref int offset)
        {
            offset += LabelEncoding.PutBytes(Name, buffer, offset);
            offset += NetworkBitConverter.PutBytes((ushort)Type,
                                                   buffer, offset);
            offset += NetworkBitConverter.PutBytes((ushort)Class,
                                                   buffer, offset);
            offset += NetworkBitConverter.PutBytes(TtlSeconds, buffer, offset);

            if (RData == null)
            {
                offset += NetworkBitConverter.PutBytes((ushort)0,
                                                       buffer, offset);
            }
            else
            {
                offset += NetworkBitConverter.PutBytes((ushort)RData.Length,
                                                       buffer, offset);
                RData.CopyTo(buffer, offset);
                offset += RData.Length;
            }
            return(offset);
        }