Methods Summary |
---|
public int | describeContents()
return 0;
|
public boolean | equals(java.lang.Object o)
if (!(o instanceof ManifestDigest)) {
return false;
}
final ManifestDigest other = (ManifestDigest) o;
return this == other || Arrays.equals(mDigest, other.mDigest);
|
static android.content.pm.ManifestDigest | fromInputStream(java.io.InputStream fileIs)
if (fileIs == null) {
return null;
}
final MessageDigest md;
try {
md = MessageDigest.getInstance(DIGEST_ALGORITHM);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(DIGEST_ALGORITHM + " must be available", e);
}
final DigestInputStream dis = new DigestInputStream(new BufferedInputStream(fileIs), md);
try {
byte[] readBuffer = new byte[8192];
while (dis.read(readBuffer, 0, readBuffer.length) != -1) {
// not using
}
} catch (IOException e) {
Slog.w(TAG, "Could not read manifest");
return null;
} finally {
IoUtils.closeQuietly(dis);
}
final byte[] digest = md.digest();
return new ManifestDigest(digest);
|
public int | hashCode()
return Arrays.hashCode(mDigest);
|
public java.lang.String | toString()
final StringBuilder sb = new StringBuilder(TO_STRING_PREFIX.length()
+ (mDigest.length * 3) + 1);
sb.append(TO_STRING_PREFIX);
final int N = mDigest.length;
for (int i = 0; i < N; i++) {
final byte b = mDigest[i];
IntegralToString.appendByteAsHex(sb, b, false);
sb.append(',");
}
sb.append('}");
return sb.toString();
|
public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeByteArray(mDigest);
|