Package okio

Class ForwardingSource

    • Constructor Detail

      • ForwardingSource

        public ForwardingSource​(Source delegate)
    • Method Detail

      • delegate

        public final Source delegate()
        Source to which this instance is delegating.
      • read

        public long read​(Buffer sink,
                         long byteCount)
                  throws IOException
        Description copied from interface: Source
        Removes at least 1, and up to byteCount bytes from this and appends them to sink. Returns the number of bytes read, or -1 if this source is exhausted.
        Specified by:
        read in interface Source
        Throws:
        IOException
      • timeout

        public Timeout timeout()
        Description copied from interface: Source
        Returns the timeout for this source.
        Specified by:
        timeout in interface 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 interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface Source
        Throws:
        IOException
      • toString

        public String toString()
        Description copied from class: Object
        Returns 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 toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.