Package okio
Class ForwardingSource
java.lang.Object
okio.ForwardingSource
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Source
- Direct Known Subclasses:
HashingSource
A
Source
which forwards calls to another. Useful for subclassing.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this source and releases the resources held by this source.final Source
delegate()
Source
to which this instance is delegating.long
Removes at least 1, and up tobyteCount
bytes from this and appends them tosink
.timeout()
Returns the timeout for this source.toString()
-
Constructor Details
-
ForwardingSource
-
-
Method Details
-
delegate
Source
to which this instance is delegating. -
read
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
Description copied from interface:Source
Returns the timeout for this source. -
close
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
-
toString
-