diff --git a/src/main/java/azgracompress/fileformat/QCMPFileHeader.java b/src/main/java/azgracompress/fileformat/QCMPFileHeader.java index 365e9636e6ef5cbba66b436f6b1ae1f65abce43c..0a0755a411ced5afb2f0ee1ac8d6784221f83084 100644 --- a/src/main/java/azgracompress/fileformat/QCMPFileHeader.java +++ b/src/main/java/azgracompress/fileformat/QCMPFileHeader.java @@ -8,7 +8,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; -public class QCMPFileHeader { +public class QCMPFileHeader implements Cloneable { public static final int BASE_QCMP_HEADER_SIZE = 23; public static final String QCMP_MAGIC_VALUE = "QCMPFILE"; @@ -57,6 +57,19 @@ public class QCMPFileHeader { return true; } + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public QCMPFileHeader copyOf() { + try { + return (QCMPFileHeader) this.clone(); + } catch (CloneNotSupportedException e) { + return null; + } + } + public void writeHeader(DataOutputStream outputStream) throws IOException { outputStream.writeBytes(QCMP_MAGIC_VALUE);