Package okio
Class ForwardingSource
- java.lang.Object
-
- okio.ForwardingSource
-
-
Constructor Summary
Constructors Constructor Description ForwardingSource(Source delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this source and releases the resources held by this source.Sourcedelegate()Sourceto which this instance is delegating.longread(Buffer sink, long byteCount)Removes at least 1, and up tobyteCountbytes from this and appends them tosink.Timeouttimeout()Returns the timeout for this source.StringtoString()Returns a string containing a concise, human-readable description of this object.
-
-
-
Constructor Detail
-
ForwardingSource
public ForwardingSource(Source delegate)
-
-
Method Detail
-
read
public long read(Buffer sink, long byteCount) throws IOException
Description copied from interface:SourceRemoves at least 1, and up tobyteCountbytes from this and appends them tosink. Returns the number of bytes read, or -1 if this source is exhausted.- Specified by:
readin interfaceSource- Throws:
IOException
-
timeout
public Timeout timeout()
Description copied from interface:SourceReturns the timeout for this source.
-
close
public void close() throws IOExceptionDescription copied from interface:SourceCloses 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSource- Throws:
IOException
-
toString
public String toString()
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod.
-
-