public final class HashSource extends DelegateSource
hash()来计算最终的哈希值| Modifier and Type | Method and Description |
|---|---|
ByteString |
hash() |
static HashSource |
hmacSha1(Source source,
ByteString key) |
static HashSource |
hmacSha256(Source source,
ByteString key) |
static HashSource |
md5(Source source) |
long |
read(Buffer sink,
long byteCount)
从中删除至少1个字节,最多为
byteCount字节, 并将它们
附加到sink。返回读取的字节数,如果该源已耗尽,则返回-1 |
static HashSource |
sha1(Source source) |
static HashSource |
sha256(Source source) |
close, delegate, timeout, toStringpublic static HashSource md5(Source source)
public static HashSource sha1(Source source)
public static HashSource sha256(Source source)
public static HashSource hmacSha1(Source source, ByteString key)
public static HashSource hmacSha256(Source source, ByteString key)
public long read(Buffer sink, long byteCount) throws IOException
SourcebyteCount字节, 并将它们
附加到sink。返回读取的字节数,如果该源已耗尽,则返回-1read in interface Sourceread in class DelegateSourcesink - 缓冲byteCount - 长度大小IOException - IOException IOException.public final ByteString hash()
Copyright © 2019. All rights reserved.