Package okio
Class GzipSource
- java.lang.Object
-
- okio.GzipSource
-
-
Constructor Summary
Constructors Constructor Description GzipSource(Source source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 tobyteCount
bytes from this and appends them tosink
.Timeout
timeout()
Returns the timeout for this source.
-
-
-
Constructor Detail
-
GzipSource
public GzipSource(Source source)
-
-
Method Detail
-
read
public long read(Buffer sink, long byteCount) throws IOException
Description copied from interface:Source
Removes at least 1, and up tobyteCount
bytes from this and appends them tosink
. Returns the number of bytes read, or -1 if this source is exhausted.- Specified by:
read
in interfaceSource
- Throws:
IOException
-
timeout
public Timeout timeout()
Description copied from interface:Source
Returns the timeout for this source.
-
close
public void close() throws IOException
Description copied from interface:Source
Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSource
- Throws:
IOException
-
-