Package okio
Class ForwardingSink
- java.lang.Object
-
- okio.ForwardingSink
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,Sink
- Direct Known Subclasses:
HashingSink
public abstract class ForwardingSink extends java.lang.Object implements Sink
ASinkwhich forwards calls to another. Useful for subclassing.
-
-
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.java.lang.StringtoString()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 java.io.IOException
Description copied from interface:SinkRemovesbyteCountbytes fromsourceand appends them to this.
-
flush
public void flush() throws java.io.IOExceptionDescription copied from interface:SinkPushes all buffered bytes to their final destination.
-
timeout
public Timeout timeout()
Description copied from interface:SinkReturns the timeout for this sink.
-
close
public void close() throws java.io.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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-