public interface Source extends Closeable
BufferedSource.inputStream() to adapt a source to an InputStream.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this source and releases the resources held by this source.
|
long |
read(Buffer sink,
long byteCount)
Removes at least 1, and up to
byteCount bytes from this and appends
them to sink. |
Timeout |
timeout()
Returns the timeout for this source.
|
long read(Buffer sink, long byteCount) throws IOException
byteCount bytes from this and appends
them to sink. Returns the number of bytes read, or -1 if this
source is exhausted.sink - BufferbyteCount - longIOException - IOException IOException.Timeout timeout()
void close()
throws IOException
close in interface AutoCloseableclose in interface CloseableIOException - IOException IOException.Copyright © 2019. All rights reserved.