code: public void flushBuffer() throws IOException {
          if (mCompressedSegments != 0) {
              throw new IOException("cannot flush a compressed buffer");
          }
          
          // marked the stream as having been previously flushed to avoid
          // attempting to compress the stream after the fact
          mFlushed = true;
          
          // write the internal buffer to the output stream and then clear any
          // data in the internal buffer to avoid duplicated data.
          ByteBuffer bytes = mBuffer;
          OutputStream out = super.getOutputStream();
          bytes.writeTo(out);
          bytes.clear();
          
          super.flushBuffer();
      }
docs: Flush the internal buffer to the output stream and clear the internal
  buffer to allow new data to be written.  If the stream was marked for
  compression, then an I/O exception is thrown as compressed streams may
  not be sent down early to the connection.