/* * Copyright 2006 Bradley Schatz. All rights reserved. * * This file is part of pasco2, the next generation Internet Explorer cache * and history record parser. * * pasco2 is free software; you can redistribute it and/or modify * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * pasco2 is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pasco2; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ package isi.pasco2.model; import isi.pasco2.util.HexFormatter; import java.io.StringWriter; public class UnknownRecord extends Record { byte[] record; public UnknownRecord(byte[] record, int offset) { this.record = record; this.offset = offset; } public String toString() { StringWriter output = new StringWriter(); output.write("Unknown record type at offset: " + Integer.toHexString(offset) + "\r\n"); output.write(HexFormatter.convertBytesToString(record)); output.write("\r\n"); return output.toString(); } public boolean equals(Object obj) { if (obj instanceof UnknownRecord) { UnknownRecord rec = (UnknownRecord) obj; if (rec.offset != this.offset) { return false; } if (this.offset != rec.offset) { return false; } if (this.record.length != rec.record.length) { return false; } for (int i=0 ; i < this.record.length ; i++) { if (rec.record[i] != this.record[i]) { return false; } } } return true; } }