package common.tags;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

class TagLong extends Tag {
	private long data;

	TagLong() {
	}

	public TagLong(long data) {
		this.data = data;
	}

	void write(DataOutput output) throws IOException {
		output.writeLong(this.data);
	}

	void read(DataInput input, int depth, SizeTracker tracker) throws IOException {
		tracker.read(16);
		this.data = input.readLong();
	}

	TagType getType() {
		return TagType.LONG;
	}

	public String toString() {
		return "" + this.data + "L";
	}

	public Tag copy() {
		return new TagLong(this.data);
	}

	public boolean equals(Object other) {
		return super.equals(other) && this.data == ((TagLong)other).data;
	}

	public int hashCode() {
		return super.hashCode() ^ (int)(this.data ^ this.data >>> 32);
	}

	public long getLong() {
		return this.data;
	}
}
