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 Details

    • closed

      protected boolean closed
  • Constructor Details

    • AbstractOutputStream

      public AbstractOutputStream()
  • Method Details

    • write

      public final void write​(int data) throws IOException
      Description copied from class: OutputStream
      Writes a single byte to this stream. Only the least significant byte of the integer oneByte is written to the stream.
      Specified by:
      write in class OutputStream
      Parameters:
      data - the byte to be written.
      Throws:
      IOException - if an error occurs while writing to this stream.
    • checkNotClosed

      protected final void checkNotClosed() throws IOException
      Throws:
      IOException
    • isClosed

      public boolean isClosed()
      Returns true if this stream was closed locally.