Package okio
Class ForwardingSink
- java.lang.Object
-
- okio.ForwardingSink
-
-
Constructor Summary
Constructors Constructor Description ForwardingSink(Sink delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Pushes all buffered bytes to their final destination and releases the resources held by this sink.Sinkdelegate()Sinkto which this instance is delegating.voidflush()Pushes all buffered bytes to their final destination.Timeouttimeout()Returns the timeout for this sink.StringtoString()Returns a string containing a concise, human-readable description of this object.voidwrite(Buffer source, long byteCount)RemovesbyteCountbytes fromsourceand appends them to this.
-
-
-
Constructor Detail
-
ForwardingSink
public ForwardingSink(Sink delegate)
-
-
Method Detail
-
write
public void write(Buffer source, long byteCount) throws IOException
Description copied from interface:SinkRemovesbyteCountbytes fromsourceand appends them to this.- Specified by:
writein interfaceSink- Throws:
IOException
-
flush
public void flush() throws IOExceptionDescription copied from interface:SinkPushes all buffered bytes to their final destination.- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceSink- Throws:
IOException- if there are any issues writing the data.
-
timeout
public Timeout timeout()
Description copied from interface:SinkReturns the timeout for this sink.
-
close
public void close() throws IOExceptionDescription copied from interface:SinkPushes all buffered bytes to their final destination and releases the resources held by this sink. It is an error to write a closed sink. It is safe to close a sink more than once.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSink- 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.
-
-