int writeHeaderWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2(this.nameTrnId, dst, dstIndex); dst[ dstIndex + OPCODE_OFFSET ] = (byte) ( ( this.isResponse ? 0x80 : 0x00 ) + ( ( this.opCode << 3 ) & 0x78 ) + ( this.isAuthAnswer ? 0x04 : 0x00 ) + ( this.isTruncated ? 0x02 : 0x00 ) + ( this.isRecurDesired ? 0x01 : 0x00 ) ); dst[ dstIndex + OPCODE_OFFSET + 1 ] = (byte) ( ( this.isRecurAvailable ? 0x80 : 0x00 ) + ( this.isBroadcast ? 0x10 : 0x00 ) + ( this.resultCode & 0x0F ) ); writeInt2(this.questionCount, dst, start + QUESTION_OFFSET); writeInt2(this.answerCount, dst, start + ANSWER_OFFSET); writeInt2(this.authorityCount, dst, start + AUTHORITY_OFFSET); writeInt2(this.additionalCount, dst, start + ADDITIONAL_OFFSET); return HEADER_LENGTH; }
int writeHeaderWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2(this.nameTrnId, dst, dstIndex); dst[ dstIndex + OPCODE_OFFSET ] = (byte) ( ( this.isResponse ? 0x80 : 0x00 ) + ( ( this.opCode << 3 ) & 0x78 ) + ( this.isAuthAnswer ? 0x04 : 0x00 ) + ( this.isTruncated ? 0x02 : 0x00 ) + ( this.isRecurDesired ? 0x01 : 0x00 ) ); dst[ dstIndex + OPCODE_OFFSET + 1 ] = (byte) ( ( this.isRecurAvailable ? 0x80 : 0x00 ) + ( this.isBroadcast ? 0x10 : 0x00 ) + ( this.resultCode & 0x0F ) ); writeInt2(this.questionCount, dst, start + QUESTION_OFFSET); writeInt2(this.answerCount, dst, start + ANSWER_OFFSET); writeInt2(this.authorityCount, dst, start + AUTHORITY_OFFSET); writeInt2(this.additionalCount, dst, start + ADDITIONAL_OFFSET); return HEADER_LENGTH; }
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2( nameTrnId, dst, dstIndex ); dst[dstIndex + OPCODE_OFFSET] = (byte)(( isResponse ? 0x80 : 0x00 ) + (( opCode << 3 ) & 0x78 ) + ( isAuthAnswer ? 0x04 : 0x00 ) + ( isTruncated ? 0x02 : 0x00 ) + ( isRecurDesired ? 0x01 : 0x00 )); dst[dstIndex + OPCODE_OFFSET + 1] = (byte)(( isRecurAvailable ? 0x80 : 0x00 ) + ( isBroadcast ? 0x10 : 0x00 ) + ( resultCode & 0x0F )); writeInt2( questionCount, dst, start + QUESTION_OFFSET ); writeInt2( answerCount, dst, start + ANSWER_OFFSET ); writeInt2( authorityCount, dst, start + AUTHORITY_OFFSET ); writeInt2( additionalCount, dst, start + ADDITIONAL_OFFSET ); return HEADER_LENGTH; } int readHeaderWireFormat( byte[] src, int srcIndex ) {
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2( nameTrnId, dst, dstIndex ); dst[dstIndex + OPCODE_OFFSET] = (byte)(( isResponse ? 0x80 : 0x00 ) + (( opCode << 3 ) & 0x78 ) + ( isAuthAnswer ? 0x04 : 0x00 ) + ( isTruncated ? 0x02 : 0x00 ) + ( isRecurDesired ? 0x01 : 0x00 )); dst[dstIndex + OPCODE_OFFSET + 1] = (byte)(( isRecurAvailable ? 0x80 : 0x00 ) + ( isBroadcast ? 0x10 : 0x00 ) + ( resultCode & 0x0F )); writeInt2( questionCount, dst, start + QUESTION_OFFSET ); writeInt2( answerCount, dst, start + ANSWER_OFFSET ); writeInt2( authorityCount, dst, start + AUTHORITY_OFFSET ); writeInt2( additionalCount, dst, start + ADDITIONAL_OFFSET ); return HEADER_LENGTH; } int readHeaderWireFormat( byte[] src, int srcIndex ) {
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2( nameTrnId, dst, dstIndex ); dst[dstIndex + OPCODE_OFFSET] = (byte)(( isResponse ? 0x80 : 0x00 ) + (( opCode << 3 ) & 0x78 ) + ( isAuthAnswer ? 0x04 : 0x00 ) + ( isTruncated ? 0x02 : 0x00 ) + ( isRecurDesired ? 0x01 : 0x00 )); dst[dstIndex + OPCODE_OFFSET + 1] = (byte)(( isRecurAvailable ? 0x80 : 0x00 ) + ( isBroadcast ? 0x10 : 0x00 ) + ( resultCode & 0x0F )); writeInt2( questionCount, dst, start + QUESTION_OFFSET ); writeInt2( answerCount, dst, start + ANSWER_OFFSET ); writeInt2( authorityCount, dst, start + AUTHORITY_OFFSET ); writeInt2( additionalCount, dst, start + ADDITIONAL_OFFSET ); return HEADER_LENGTH; } int readHeaderWireFormat( byte[] src, int srcIndex ) {
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; writeInt2( nameTrnId, dst, dstIndex ); dst[dstIndex + OPCODE_OFFSET] = (byte)(( isResponse ? 0x80 : 0x00 ) + (( opCode << 3 ) & 0x78 ) + ( isAuthAnswer ? 0x04 : 0x00 ) + ( isTruncated ? 0x02 : 0x00 ) + ( isRecurDesired ? 0x01 : 0x00 )); dst[dstIndex + OPCODE_OFFSET + 1] = (byte)(( isRecurAvailable ? 0x80 : 0x00 ) + ( isBroadcast ? 0x10 : 0x00 ) + ( resultCode & 0x0F )); writeInt2( questionCount, dst, start + QUESTION_OFFSET ); writeInt2( answerCount, dst, start + ANSWER_OFFSET ); writeInt2( authorityCount, dst, start + AUTHORITY_OFFSET ); writeInt2( additionalCount, dst, start + ADDITIONAL_OFFSET ); return HEADER_LENGTH; } int readHeaderWireFormat( byte[] src, int srcIndex ) {
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; } int readQuestionSectionWireFormat( byte[] src, int srcIndex ) {
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; } int readQuestionSectionWireFormat( byte[] src, int srcIndex ) {
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; } int readQuestionSectionWireFormat( byte[] src, int srcIndex ) {
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; } int readQuestionSectionWireFormat( byte[] src, int srcIndex ) {
int writeResourceRecordWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; if( recordName == questionName ) { dst[dstIndex++] = (byte)0xC0; // label string pointer to dst[dstIndex++] = (byte)0x0C; // questionName (offset 12) } else { 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; } int readResourceRecordWireFormat( byte[] src, int srcIndex ) {
int writeResourceRecordWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; if ( this.recordName == this.questionName ) { dst[ dstIndex++ ] = (byte) 0xC0; // label string pointer to dst[ dstIndex++ ] = (byte) 0x0C; // questionName (offset 12) } else { dstIndex += this.recordName.writeWireFormat(dst, dstIndex); } writeInt2(this.recordType, dst, dstIndex); dstIndex += 2; writeInt2(this.recordClass, dst, dstIndex); dstIndex += 2; writeInt4(this.ttl, dst, dstIndex); dstIndex += 4; this.rDataLength = writeRDataWireFormat(dst, dstIndex + 2); writeInt2(this.rDataLength, dst, dstIndex); dstIndex += 2 + this.rDataLength; return dstIndex - start; }
int writeResourceRecordWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; if ( this.recordName == this.questionName ) { dst[ dstIndex++ ] = (byte) 0xC0; // label string pointer to dst[ dstIndex++ ] = (byte) 0x0C; // questionName (offset 12) } else { dstIndex += this.recordName.writeWireFormat(dst, dstIndex); } writeInt2(this.recordType, dst, dstIndex); dstIndex += 2; writeInt2(this.recordClass, dst, dstIndex); dstIndex += 2; writeInt4(this.ttl, dst, dstIndex); dstIndex += 4; this.rDataLength = writeRDataWireFormat(dst, dstIndex + 2); writeInt2(this.rDataLength, dst, dstIndex); dstIndex += 2 + this.rDataLength; return dstIndex - start; }
int writeResourceRecordWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; if( recordName == questionName ) { dst[dstIndex++] = (byte)0xC0; // label string pointer to dst[dstIndex++] = (byte)0x0C; // questionName (offset 12) } else { 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; } int readResourceRecordWireFormat( byte[] src, int srcIndex ) {
int writeResourceRecordWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; if( recordName == questionName ) { dst[dstIndex++] = (byte)0xC0; // label string pointer to dst[dstIndex++] = (byte)0x0C; // questionName (offset 12) } else { 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; } int readResourceRecordWireFormat( byte[] src, int srcIndex ) {
int writeResourceRecordWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; if( recordName == questionName ) { dst[dstIndex++] = (byte)0xC0; // label string pointer to dst[dstIndex++] = (byte)0x0C; // questionName (offset 12) } else { 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; } int readResourceRecordWireFormat( byte[] src, int srcIndex ) {