⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashwrapper2.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   HashWrapper2.java

package org.gudy.azureus2.core3.util;


public class HashWrapper2
{

	private final byte hash[];
	private final short offset;
	private final short length;
	private final int hash_code;

	public HashWrapper2(byte hash[])
	{
		this(hash, 0, hash.length);
	}

	public HashWrapper2(byte _hash[], int _offset, int _length)
	{
		if (_offset >= 32767)
			throw new RuntimeException("Illegal value - offset too large");
		if (_length >= 32767)
			throw new RuntimeException("Illegal value - length too large");
		hash = _hash;
		offset = (short)_offset;
		length = (short)_length;
		int hc = 0;
		for (int i = offset; i < offset + length; i++)
			hc = 31 * hc + hash[i];

		hash_code = hc;
	}

	public final boolean equals(Object o)
	{
		if (!(o instanceof HashWrapper2))
			return false;
		HashWrapper2 other = (HashWrapper2)o;
		if (other.length != length)
			return false;
		byte other_hash[] = other.hash;
		int other_offset = other.offset;
		for (int i = 0; i < length; i++)
			if (hash[offset + i] != other_hash[other_offset + i])
				return false;

		return true;
	}

	public int hashCode()
	{
		return hash_code;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -