1 // Copyright (c) 1999-2004 Brian Wellington (bwelling (at) xbill.org) 2 3 package org.xbill.DNS; 4 5 import java.io.*; 6 7 /** 8 * A class implementing Records of unknown and/or unimplemented types. This 9 * 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 static final long serialVersionUID = -4193583311594626915L; 17 18 private byte [] data; 19 20 UNKRecord() {} 21 22 Record 23 getObject() { 24 return new UNKRecord(); 25 } 26 27 void 28 rrFromWire(DNSInput in) throws IOException { 29 data = in.readByteArray(); 30 } 31 32 void 33 rdataFromString(Tokenizer st, Name origin) throws IOException { 34 throw st.exception("invalid unknown RR encoding"); 35 } 36 37 /** Converts this Record to the String "unknown format" */ 38 String 39 rrToString() { 40 return unknownToString(data); 41 } 42 43 /** Returns the contents of this record. */ 44 public byte [] 45 getData() { 46 return data; 47 } 48 49 void 50 rrToWire(DNSOutput out, Compression c, boolean canonical) { 51 out.writeByteArray(data); 52 } 53 54 } 55