1// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org) 2 3package org.xbill.DNS; 4 5import 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 14public class UNKRecord extends Record { 15 16private static final long serialVersionUID = -4193583311594626915L; 17 18private byte [] data; 19 20UNKRecord() {} 21 22Record 23getObject() { 24 return new UNKRecord(); 25} 26 27void 28rrFromWire(DNSInput in) throws IOException { 29 data = in.readByteArray(); 30} 31 32void 33rdataFromString(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" */ 38String 39rrToString() { 40 return unknownToString(data); 41} 42 43/** Returns the contents of this record. */ 44public byte [] 45getData() { 46 return data; 47} 48 49void 50rrToWire(DNSOutput out, Compression c, boolean canonical) { 51 out.writeByteArray(data); 52} 53 54} 55