Package com.squareup.okhttp.internal
Class AbstractOutputStream
java.lang.Object
java.io.OutputStream
com.squareup.okhttp.internal.AbstractOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
FaultRecoveringOutputStream
public abstract class AbstractOutputStream extends OutputStream
An output stream for an HTTP request body.
Since a single socket's output stream may be used to write multiple HTTP requests to the same server, subclasses should not close the socket stream.
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosed -
Constructor Summary
Constructors Constructor Description AbstractOutputStream() -
Method Summary
Modifier and Type Method Description protected voidcheckNotClosed()booleanisClosed()Returns true if this stream was closed locally.voidwrite(int data)Writes a single byte to this stream.Methods inherited from class java.io.OutputStream
close, flush, write, write
-
Field Details
-
closed
protected boolean closed
-
-
Constructor Details
-
AbstractOutputStream
public AbstractOutputStream()
-
-
Method Details
-
write
Description copied from class:OutputStreamWrites a single byte to this stream. Only the least significant byte of the integeroneByteis written to the stream.- Specified by:
writein classOutputStream- Parameters:
data- the byte to be written.- Throws:
IOException- if an error occurs while writing to this stream.
-
checkNotClosed
- Throws:
IOException
-
isClosed
public boolean isClosed()Returns true if this stream was closed locally.
-