01: // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: import java.io.*;
06:
07: /**
08: * A class implementing Records of unknown and/or unimplemented types. This
09: * class can only be initialized using static Record initializers.
10: *
11: * @author Brian Wellington
12: */
13:
14: public class UNKRecord extends Record {
15:
16: private byte[] data;
17:
18: UNKRecord() {
19: }
20:
21: Record getObject() {
22: return new UNKRecord();
23: }
24:
25: void rrFromWire(DNSInput in) throws IOException {
26: data = in.readByteArray();
27: }
28:
29: void rdataFromString(Tokenizer st, Name origin) throws IOException {
30: throw st.exception("invalid unknown RR encoding");
31: }
32:
33: /** Converts this Record to the String "unknown format" */
34: String rrToString() {
35: return unknownToString(data);
36: }
37:
38: /** Returns the contents of this record. */
39: public byte[] getData() {
40: return data;
41: }
42:
43: void rrToWire(DNSOutput out, Compression c, boolean canonical) {
44: out.writeByteArray(data);
45: }
46:
47: }
|