| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
Util.discard(Source source,
int timeout,
TimeUnit timeUnit)
Attempts to exhaust
source, returning true if successful. |
static boolean |
Util.skipAll(Source source,
int duration,
TimeUnit timeUnit)
Reads until
in is exhausted or the deadline has been reached. |
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
DiskLruCache.Snapshot.getSource(int index)
Returns the unbuffered stream with the value for
index. |
Source |
DiskLruCache.Editor.newSource(int index)
Returns an unbuffered input stream to read the last committed value, or null if no value has
been committed.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
ExchangeCodec.openResponseBodySource(Response response) |
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
Http1ExchangeCodec.openResponseBodySource(Response response) |
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
Http2Stream.getSource()
Returns a source that reads data from the peer.
|
Source |
Http2ExchangeCodec.openResponseBodySource(Response response) |
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
FileSystem.source(File file)
Reads from
file. |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
BufferedSource
A source that keeps a buffer internally so that callers can do small reads without a performance
penalty.
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
Buffer
A collection of bytes in memory.
|
class |
ForwardingSource
A
Source which forwards calls to another. |
class |
GzipSource
A source that uses GZIP to decompress data read
from another source.
|
class |
HashingSource
A source that computes a hash of the full stream of bytes it has supplied.
|
class |
InflaterSource
A source that uses DEFLATE to decompress data
read from another source.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Source |
ForwardingSource.delegate()
Source to which this instance is delegating. |
Source |
Pipe.source() |
static Source |
Okio.source(File file)
Returns a source that reads from
file. |
static Source |
Okio.source(InputStream in)
Returns a source that reads from
in. |
static Source |
Okio.source(Path path,
OpenOption... options)
Returns a source that reads from
path. |
static Source |
Okio.source(Socket socket)
Returns a source that reads from
socket. |
Source |
AsyncTimeout.source(Source source)
Returns a new source that delegates to
source, using this to implement timeouts. |
| 限定符和类型 | 方法和说明 |
|---|---|
static BufferedSource |
Okio.buffer(Source source)
Returns a new source that buffers reads from
source. |
static HashingSource |
HashingSource.hmacSha1(Source source,
ByteString key)
Returns a sink that uses the obsolete SHA-1 HMAC algorithm to produce 160-bit hashes.
|
static HashingSource |
HashingSource.hmacSha256(Source source,
ByteString key)
Returns a sink that uses the SHA-256 HMAC algorithm to produce 256-bit hashes.
|
static HashingSource |
HashingSource.md5(Source source)
Returns a sink that uses the obsolete MD5 hash algorithm to produce 128-bit hashes.
|
static HashingSource |
HashingSource.sha1(Source source)
Returns a sink that uses the obsolete SHA-1 hash algorithm to produce 160-bit hashes.
|
static HashingSource |
HashingSource.sha256(Source source)
Returns a sink that uses the SHA-256 hash algorithm to produce 256-bit hashes.
|
Source |
AsyncTimeout.source(Source source)
Returns a new source that delegates to
source, using this to implement timeouts. |
BufferedSink |
Buffer.write(Source source,
long byteCount) |
BufferedSink |
BufferedSink.write(Source source,
long byteCount)
Removes
byteCount bytes from source and appends them to this sink. |
long |
Buffer.writeAll(Source source) |
long |
BufferedSink.writeAll(Source source)
Removes all bytes from
source and appends them to this sink. |
| 构造器和说明 |
|---|
ForwardingSource(Source delegate) |
GzipSource(Source source) |
InflaterSource(Source source,
Inflater inflater) |
Copyright © 2025. All rights reserved.