WriteWireFormat() private méthode

private WriteWireFormat ( byte dst, int dstIndex ) : int
dst byte
dstIndex int
Résultat int
Exemple #1
0
        internal virtual int WriteResourceRecordWireFormat(byte[] dst, int dstIndex)
        {
            int start = dstIndex;

            if (RecordName == QuestionName)
            {
                dst[dstIndex++] = unchecked (unchecked (0xC0));
                // label string pointer to
                dst[dstIndex++] = unchecked (unchecked (0x0C));
            }
            else
            {
                // questionName (offset 12)
                dstIndex += RecordName.WriteWireFormat(dst, dstIndex);
            }
            WriteInt2(RecordType, dst, dstIndex);
            dstIndex += 2;
            WriteInt2(RecordClass, dst, dstIndex);
            dstIndex += 2;
            WriteInt4(Ttl, dst, dstIndex);
            dstIndex   += 4;
            RDataLength = WriteRDataWireFormat(dst, dstIndex + 2);
            WriteInt2(RDataLength, dst, dstIndex);
            dstIndex += 2 + RDataLength;
            return(dstIndex - start);
        }
Exemple #2
0
        internal override int WriteTrailerWireFormat(byte[] dst, int dstIndex)
        {
            int start = dstIndex;

            dstIndex += _calledName.WriteWireFormat(dst, dstIndex);
            dstIndex += _callingName.WriteWireFormat(dst, dstIndex);
            return(dstIndex - start);
        }
Exemple #3
0
        internal virtual int WriteQuestionSectionWireFormat(byte[] dst, int dstIndex)
        {
            int start = dstIndex;

            dstIndex += QuestionName.WriteWireFormat(dst, dstIndex);
            WriteInt2(QuestionType, dst, dstIndex);
            dstIndex += 2;
            WriteInt2(QuestionClass, dst, dstIndex);
            dstIndex += 2;
            return(dstIndex - start);
        }