internal virtual int ReadResourceRecordWireFormat(byte[] src, int srcIndex) { int start = srcIndex; int end; if ((src[srcIndex] & unchecked (0xC0)) == unchecked (0xC0)) { RecordName = QuestionName; // label string pointer to questionName srcIndex += 2; } else { srcIndex += RecordName.ReadWireFormat(src, srcIndex); } RecordType = ReadInt2(src, srcIndex); srcIndex += 2; RecordClass = ReadInt2(src, srcIndex); srcIndex += 2; Ttl = ReadInt4(src, srcIndex); srcIndex += 4; RDataLength = ReadInt2(src, srcIndex); srcIndex += 2; AddrEntry = new NbtAddress[RDataLength / 6]; end = srcIndex + RDataLength; for (AddrIndex = 0; srcIndex < end; AddrIndex++) { srcIndex += ReadRDataWireFormat(src, srcIndex); } return(srcIndex - start); }
internal virtual int ReadQuestionSectionWireFormat(byte[] src, int srcIndex) { int start = srcIndex; srcIndex += QuestionName.ReadWireFormat(src, srcIndex); QuestionType = ReadInt2(src, srcIndex); srcIndex += 2; QuestionClass = ReadInt2(src, srcIndex); srcIndex += 2; return(srcIndex - start); }
/// <exception cref="System.IO.IOException"></exception> internal override int ReadTrailerWireFormat(InputStream @in, byte[] buffer, int bufferIndex) { int start = bufferIndex; if (@in.Read(buffer, bufferIndex, Length) != Length) { throw new IOException("invalid session request wire format"); } bufferIndex += _calledName.ReadWireFormat(buffer, bufferIndex); bufferIndex += _callingName.ReadWireFormat(buffer, bufferIndex); return(bufferIndex - start); }