Class RetryableSink
- java.lang.Object
-
- com.squareup.okhttp.internal.http.RetryableSink
-
-
Constructor Summary
Constructors Constructor Description RetryableSink()RetryableSink(int limit)
-
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.longcontentLength()voidflush()Pushes all buffered bytes to their final destination.Timeouttimeout()Returns the timeout for this sink.voidwrite(Buffer source, long byteCount)RemovesbyteCountbytes fromsourceand appends them to this.voidwriteToSocket(Sink socketOut)
-
-
-
Method Detail
-
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
-
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.
-
contentLength
public long contentLength() throws IOException- Throws:
IOException
-
writeToSocket
public void writeToSocket(Sink socketOut) throws IOException
- Throws:
IOException
-
-